Skip to content

Commit a088a1e

Browse files
committed
PDFBOX-5660: optimize, as suggested by Valery Bokov; closes #278
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1929018 13f79535-47bb-0310-9956-ffa450edef68
1 parent 33000c1 commit a088a1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fontbox/src/main/java/org/apache/fontbox/cff/CharStringCommand.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ public enum CharStringCommand
9090

9191
static
9292
{
93-
int max = Arrays.stream(CharStringCommand.values()).mapToInt(CharStringCommand::getValue)
94-
.max().orElseThrow();
93+
CharStringCommand[] values = CharStringCommand.values();
94+
int max = Arrays.stream(values).mapToInt(CharStringCommand::getValue).max().orElseThrow();
9595
COMMANDS_BY_VALUE = new CharStringCommand[max + 1];
96-
Arrays.stream(CharStringCommand.values()).forEach(c -> COMMANDS_BY_VALUE[c.getValue()] = c);
96+
Arrays.stream(values).forEach(c -> COMMANDS_BY_VALUE[c.getValue()] = c);
9797
}
9898

9999
private final Type1KeyWord type1KeyWord;

0 commit comments

Comments
 (0)