Skip to content

Commit

Permalink
Update JMH. Improve addAll methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
wrandelshofer committed Aug 30, 2024
1 parent d142776 commit e9323fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ public ChampSet<E> add(@Nullable E element) {
@Override
@SuppressWarnings("unchecked")
public ChampSet<E> addAll(Iterable<? extends E> c) {
if(isEmpty()&&c instanceof ChampSet<? extends E> s){
return (ChampSet<E>) s;
}
var m = toMutable();
return m.addAll(c) ? m.toImmutable() : this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ public ChampVectorSet<E> add(@Nullable E key) {
@Override
@SuppressWarnings({"unchecked"})
public ChampVectorSet<E> addAll(Iterable<? extends E> c) {
if(isEmpty()&&c instanceof ChampVectorSet<? extends E> s){
return (ChampVectorSet<E>) s;
}
var m = toMutable();
return m.addAll(c) ? m.toImmutable() : this;
}
Expand Down
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,6 @@
<version>1.37</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.37</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jspecify/jspecify -->
<dependency>
<groupId>org.jspecify</groupId>
Expand Down

0 comments on commit e9323fc

Please sign in to comment.