Skip to content

Commit 6b5ecb2

Browse files
committed
使用entrySet代替keySet提高效率 #48
1 parent c38ad8c commit 6b5ecb2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

APIJSONORM/src/main/java/apijson/orm/AbstractParser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ public Object getValueByPath(String valuePath) {
13981398
String path = entry.getKey();
13991399
if (valuePath.startsWith(path + "/")) {
14001400
try {
1401-
parent = (JSONObject) queryResultMap.get(path);
1401+
parent = (JSONObject) entry.getValue();
14021402
} catch (Exception e) {
14031403
Log.e(TAG, "getValueByPath try { parent = (JSONObject) queryResultMap.get(path); } catch { "
14041404
+ "\n parent not instanceof JSONObject!");

APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,7 @@ public Object getWhere(String key, boolean exactMatch) {
13511351
String k = entry.getKey();
13521352
index = k.indexOf(key);
13531353
if (index >= 0 && StringUtil.isName(k.substring(index)) == false) {
1354-
return where.get(k);
1354+
return entry.getValue();
13551355
}
13561356
}
13571357
}
@@ -2304,7 +2304,7 @@ public String getSetString(RequestMethod method, Map<String, Object> content, bo
23042304
} else {
23052305
keyType = 0; //注意重置类型,不然不该加减的字段会跟着加减
23062306
}
2307-
value = content.get(key);
2307+
value = entry.getValue();
23082308
key = getRealKey(method, key, false, true, verifyName);
23092309

23102310
setString += (isFirst ? "" : ", ") + (getKey(key) + " = " + (keyType == 1 ? getAddString(key, value) : (keyType == 2

0 commit comments

Comments
 (0)