WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 8299bb0

Browse files
authored
Use reference check first for minor throughput gain (#10138)
In microbenchmarks, this shows a 1-1.5% improvement on finding entries (which also impacts map creation). The gain will increase for maps with larger collisions chain
1 parent ad97c35 commit 8299bb0

File tree

1 file changed

+1
-1
lines changed
  • internal-api/src/main/java/datadog/trace/api

1 file changed

+1
-1
lines changed

internal-api/src/main/java/datadog/trace/api/TagMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public final String tag() {
290290
}
291291

292292
public final boolean matches(String tag) {
293-
return this.tag.equals(tag);
293+
return (this.tag == tag) || this.tag.equals(tag);
294294
}
295295

296296
public abstract boolean isRemoval();

0 commit comments

Comments
 (0)