This is an automated email from the ASF dual-hosted git repository.
He-Pin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko.git
The following commit(s) were added to refs/heads/main by this push:
new 6628442f16 fix: remove redundant Float cast in CountMinSketch pattern
match (#3142)
6628442f16 is described below
commit 6628442f166716d592fc9dc9684dc2237e2f919a
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Tue Jun 23 17:17:55 2026 +0800
fix: remove redundant Float cast in CountMinSketch pattern match (#3142)
Motivation:
CountMinSketch.java line 181 uses `(Float) o` cast inside an
`instanceof Float f` pattern match, but `f` is already bound to
the Float value. The cast is redundant.
Modification:
Use the pattern variable `f` directly instead of `(Float) o`.
Result:
Cleaner code, no functional change.
Tests:
sbt "remote/compile" — passed
References:
Refs #3136
---
.../java/org/apache/pekko/remote/artery/compress/CountMinSketch.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/remote/src/main/java/org/apache/pekko/remote/artery/compress/CountMinSketch.java
b/remote/src/main/java/org/apache/pekko/remote/artery/compress/CountMinSketch.java
index c936770d2a..ed6c633794 100644
---
a/remote/src/main/java/org/apache/pekko/remote/artery/compress/CountMinSketch.java
+++
b/remote/src/main/java/org/apache/pekko/remote/artery/compress/CountMinSketch.java
@@ -178,7 +178,7 @@ public class CountMinSketch {
return hashLong(Double.doubleToRawLongBits(d), 0);
}
if (o instanceof Float f) {
- return hashLong(Float.floatToRawIntBits((Float) o), 0);
+ return hashLong(Float.floatToRawIntBits(f), 0);
}
if (o instanceof byte[] array) {
return bytesHash(array, 0);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]