Skip to content

Commit b18cbde

Browse files
committed
优化性能,非[]子object的只取1个
1 parent 8e562e7 commit b18cbde

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • APIJSON(Server)/APIJSON(Eclipse_JEE)/src/main/java/zuo/biao/apijson/server

APIJSON(Server)/APIJSON(Eclipse_JEE)/src/main/java/zuo/biao/apijson/server/RequestParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ private JSONObject getObject(String parentPath, final QueryConfig parentConfig,
383383
boolean nameIsNumber = StringUtil.isNumer(name);
384384
QueryConfig config = nameIsNumber ? parentConfig : null;
385385
if (config == null) {
386-
config = new QueryConfig(requestMethod, name);//性能会更好吗?.setCount(1);
386+
config = new QueryConfig(requestMethod, name).setCount(1);
387387
}
388388
//避免"[]":{"0":{"1":{}}}这种导致第3层当成[]的直接子Object
389389
if (nameIsNumber && ("" + config.getPosition()).equals(name) == false) {

0 commit comments

Comments
 (0)