Skip to content

Commit

Permalink
🐺💻
Browse files Browse the repository at this point in the history
  • Loading branch information
AmarokIce committed Sep 28, 2024
1 parent 477d3ea commit 24499e3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package band.kessoku.lib.config.values;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Sets;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Unmodifiable;
Expand Down Expand Up @@ -113,7 +114,11 @@ public boolean remove(Object o) {

@Override
public boolean containsAll(@NotNull Collection<?> c) {
return this.value.containsAll(c);
/* Amarok Note:
* ArrayList 的数据存储量不可知的情况下,悲观假设有大量数据,那么 ArrayList#containsAll 的效率会低的令人发指...
* 虽说如果数据量少的话套一层 Set 也是无端浪费性能... 但我依然建议悲观演算。
* */
return Sets.newHashSet(this.value).containsAll(c);
}

@Override
Expand Down

0 comments on commit 24499e3

Please sign in to comment.