Skip to content

Commit 4a1ae5c

Browse files
committed
simplify code, fixes spotbugs warning
1 parent 71e25a2 commit 4a1ae5c

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

‎graalpython/com.oracle.graal.python.processor/src/com/oracle/graal/python/processor/CApiBuiltinsProcessor.java‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -592,13 +592,7 @@ private void generateCApiHeader(List<CApiBuiltinDesc> javaBuiltins, Map<String,
592592
* {@link NativeCAPISymbol.FUN_GET_METHODS_FLAGS}
593593
*/
594594
lines.add("");
595-
List<Map.Entry<String, Long>> methodFlagsDefines = new ArrayList<>();
596-
methodFlagsDefines.addAll(methodFlags.entrySet());
597-
methodFlagsDefines.sort((a, b) -> a.getValue().compareTo(b.getValue()));
598-
for (var entry : methodFlagsDefines) {
599-
lines.add("#define " + entry.getKey() + " " + entry.getValue());
600-
}
601-
595+
methodFlags.entrySet().stream().sorted((a, b) -> a.getValue().compareTo(b.getValue())).forEach(e -> lines.add("#define " + e.getKey() + " " + e.getValue()));
602596
updateResource("capi.gen.h", javaBuiltins, lines);
603597
}
604598

0 commit comments

Comments
 (0)