Skip to content

Commit 70874c8

Browse files
fsmike64jknack
authored andcommitted
Replaced String.split with StringUtils version to avoid regex compilation
1 parent 3378cef commit 70874c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

handlebars/src/main/java/com/github/jknack/handlebars/internal/TemplateBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ private Variable newVar(final Token name, final TagType varType, final List<Para
382382
}
383383
}
384384
}
385-
String[] parts = varName.split("\\./");
385+
String[] parts = StringUtils.splitByWholeSeparator(varName, "./");
386386
// TODO: try to catch this with ANTLR...
387387
// foo.0 isn't allowed, it must be foo.0.
388388
if (parts.length > 0 && NumberUtils.isCreatable(parts[parts.length - 1])

0 commit comments

Comments
 (0)