mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Use String.indexOf(char) when checking for the index of a single character; it executes faster.
This commit is contained in:
@@ -62,7 +62,7 @@ public class MapComparator<K extends Object, V extends Object> implements Compar
|
||||
String keyStr = (String) key;
|
||||
|
||||
if (keyStr.matches(".+\\[[0-9]+\\]")) {
|
||||
Object value = map.get(keyStr.substring(0, keyStr.indexOf("[")));
|
||||
Object value = map.get(keyStr.substring(0, keyStr.indexOf('[')));
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user