Skip to content

Commit e1a6de3

Browse files
dougqhclaude
andcommitted
Fix clone_synchronizedSet to clone the synchronized set (not the plain one)
Per Codex review: it copied `hashSet`, unlike the other clone_* methods which copy their own structure. Copy `synchronizedSet` so it faithfully measures cloning the synchronized variant. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 78075dc commit e1a6de3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal-api/src/jmh/java/datadog/trace/util/SingleThreadedSetBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public Set<String> clone_hashSet() {
153153

154154
@Benchmark
155155
public Set<String> clone_synchronizedSet() {
156-
return Collections.synchronizedSet(new HashSet<>(hashSet));
156+
return Collections.synchronizedSet(new HashSet<>(synchronizedSet));
157157
}
158158

159159
@Benchmark

0 commit comments

Comments
 (0)