Skip to content

Commit

Permalink
Remove unnecessary array
Browse files Browse the repository at this point in the history
Usage of this array seems to have been dropped by lightbend#280, but the array
remained.

Cleaning up so it doesn't allocate the array needlessly anymore.

Fixes lightbend#730.
  • Loading branch information
hkupty committed May 21, 2021
1 parent f92a4ee commit fca5de9
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions config/src/main/java/com/typesafe/config/impl/PathParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,6 @@ private static boolean looksUnsafeForFastParser(String s) {
private static Path fastPathBuild(Path tail, String s, int end) {
// lastIndexOf takes last index it should look at, end - 1 not end
int splitAt = s.lastIndexOf('.', end - 1);
ArrayList<Token> tokens = new ArrayList<Token>();
tokens.add(Tokens.newUnquotedText(null, s));
// this works even if splitAt is -1; then we start the substring at 0
Path withOneMoreElement = new Path(s.substring(splitAt + 1, end), tail);
if (splitAt < 0) {
Expand Down

0 comments on commit fca5de9

Please sign in to comment.