mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-18 22:37:14 +00:00
Optimize: entrySet is faster than keySet + get to prevent N lookups (#10496)
* Optimize: replace keySet + N get calls with entrySet saving N calls to get method in a few places * missed one performance optimization * Rolling back a change that was dependent on Java 11
This commit is contained in:
@@ -721,8 +721,9 @@ public class CodeGenMojo extends AbstractMojo {
|
||||
getLog().warn("environmentVariables is deprecated and will be removed in version 5.1. Use globalProperties instead.");
|
||||
}
|
||||
|
||||
for (String key : globalProperties.keySet()) {
|
||||
String value = globalProperties.get(key);
|
||||
for (Map.Entry<String, String> globalPropertiesEntry : globalProperties.entrySet()) {
|
||||
String key = globalPropertiesEntry.getKey();
|
||||
String value = globalPropertiesEntry.getValue();
|
||||
if (value != null) {
|
||||
configurator.addGlobalProperty(key, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user