Fix Counter#decrement recursive call (#5665)

This commit is contained in:
Emily 2021-05-17 15:19:02 -03:00 committed by GitHub
parent 21ac7dc988
commit 1514576281
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2018,7 +2018,7 @@ index 0000000000000000000000000000000000000000..632c4961515f5052551f841cfa840e60
+} +}
diff --git a/src/main/java/co/aikar/util/Counter.java b/src/main/java/co/aikar/util/Counter.java diff --git a/src/main/java/co/aikar/util/Counter.java b/src/main/java/co/aikar/util/Counter.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..80155072d1004e34e04342d434cf7d75f0b7e29d index 0000000000000000000000000000000000000000..eff63c371c39e21a5a9cb5af8c2dcf78a60dd52b
--- /dev/null --- /dev/null
+++ b/src/main/java/co/aikar/util/Counter.java +++ b/src/main/java/co/aikar/util/Counter.java
@@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
@ -2041,7 +2041,7 @@ index 0000000000000000000000000000000000000000..80155072d1004e34e04342d434cf7d75
+ return increment(key, 1); + return increment(key, 1);
+ } + }
+ public long decrement(@Nullable T key, long amount) { + public long decrement(@Nullable T key, long amount) {
+ return decrement(key, -amount); + return increment(key, -amount);
+ } + }
+ public long increment(@Nullable T key, long amount) { + public long increment(@Nullable T key, long amount) {
+ Long count = this.getCount(key); + Long count = this.getCount(key);