Skip to content

Commit

Permalink
[typeTag] Fix regex in typetag parsing
Browse files Browse the repository at this point in the history
/.*:.*/ can be simplified to /:/, and reduces overhead in matching
  • Loading branch information
gregnazario committed Feb 13, 2024
1 parent 93df143 commit 24ea1cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transactions/typeTag/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ function parseTypeTagInner(str: string, types: Array<TypeTag>, allowGenerics: bo
}

// If the value doesn't contain a colon, then we'll assume it isn't trying to be a struct
if (!str.match(/.*:.*/)) {
if (!str.match(/:/)) {
throw new TypeTagParserError(str, TypeTagParserErrorType.InvalidTypeTag);
}

Expand Down

0 comments on commit 24ea1cb

Please sign in to comment.