oxsean commented on code in PR #15445: URL: https://github.com/apache/dubbo/pull/15445#discussion_r2137876444
########## dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/rest/mapping/RadixTree.java: ########## @@ -83,9 +95,16 @@ public T addPath(PathExpression path, T value) { Node<T> child = getChild(current, segments[i]); if (i == len - 1) { List<Pair<PathExpression, T>> values = child.values; - for (int j = 0, size = values.size(); j < size; j++) { - if (values.get(j).getLeft().equals(path)) { - return values.get(j).getRight(); + for (Pair<PathExpression, T> pathExpressionTPair : values) { Review Comment: Minor: Why using an index-based loop because it can avoid create an iterator object to reduce object allocation. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org