Skip to content

Commit a5af65b

Browse files
committed
fix diff method can not be added to RadixTree
1 parent c31164a commit a5af65b

File tree

1 file changed

+6
-3
lines changed
  • dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/rest/mapping

1 file changed

+6
-3
lines changed

dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/rest/mapping/RadixTree.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,12 @@ public T addPath(PathExpression path, T value) {
8383
Node<T> child = getChild(current, segments[i]);
8484
if (i == len - 1) {
8585
List<Pair<PathExpression, T>> values = child.values;
86-
for (int j = 0, size = values.size(); j < size; j++) {
87-
if (values.get(j).getLeft().equals(path)) {
88-
return values.get(j).getRight();
86+
for (Pair<PathExpression, T> pathExpressionTPair : values) {
87+
if (pathExpressionTPair.getLeft().equals(path)) {
88+
T rightVal = pathExpressionTPair.getRight();
89+
if (rightVal.equals(value)) {
90+
return rightVal;
91+
}
8992
}
9093
}
9194
values.add(Pair.of(path, value));

0 commit comments

Comments
 (0)