mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 23:37:13 -06:00
UIDefaultsLoader: minor optimization (avoid String.substring() and avoid double searching for '.')
This commit is contained in:
@@ -211,14 +211,17 @@ class UIDefaultsLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
// override UI defaults with globals
|
// override UI defaults with globals
|
||||||
for( Object okey : defaults.keySet() ) {
|
for( Object key : defaults.keySet() ) {
|
||||||
if( okey instanceof String && ((String)okey).contains( "." ) ) {
|
int dot;
|
||||||
String key = (String) okey;
|
if( !(key instanceof String) ||
|
||||||
String globalKey = key.substring( key.lastIndexOf( '.' ) + 1 );
|
properties.containsKey( key ) ||
|
||||||
String globalValue = globals.get( globalKey );
|
(dot = ((String)key).lastIndexOf( '.' )) < 0 )
|
||||||
if( globalValue != null && !properties.containsKey( key ) )
|
continue;
|
||||||
properties.put( key, globalValue );
|
|
||||||
}
|
String globalKey = ((String)key).substring( dot + 1 );
|
||||||
|
String globalValue = globals.get( globalKey );
|
||||||
|
if( globalValue != null )
|
||||||
|
properties.put( key, globalValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
Function<String, String> propertiesGetter = key -> {
|
Function<String, String> propertiesGetter = key -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user