Skip to content

Commit

Permalink
使用entrySet代替keySet提高效率 Tencent#48
Browse files Browse the repository at this point in the history
  • Loading branch information
Rkyzzy committed Apr 24, 2021
1 parent c38ad8c commit 6b5ecb2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion APIJSONORM/src/main/java/apijson/orm/AbstractParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ public Object getValueByPath(String valuePath) {
String path = entry.getKey();
if (valuePath.startsWith(path + "/")) {
try {
parent = (JSONObject) queryResultMap.get(path);
parent = (JSONObject) entry.getValue();
} catch (Exception e) {
Log.e(TAG, "getValueByPath try { parent = (JSONObject) queryResultMap.get(path); } catch { "
+ "\n parent not instanceof JSONObject!");
Expand Down
4 changes: 2 additions & 2 deletions APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ public Object getWhere(String key, boolean exactMatch) {
String k = entry.getKey();
index = k.indexOf(key);
if (index >= 0 && StringUtil.isName(k.substring(index)) == false) {
return where.get(k);
return entry.getValue();
}
}
}
Expand Down Expand Up @@ -2304,7 +2304,7 @@ public String getSetString(RequestMethod method, Map<String, Object> content, bo
} else {
keyType = 0; //注意重置类型,不然不该加减的字段会跟着加减
}
value = content.get(key);
value = entry.getValue();
key = getRealKey(method, key, false, true, verifyName);

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

0 comments on commit 6b5ecb2

Please sign in to comment.