You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2019/10/21 16:41:11 UTC
[commons-rng] 01/02: Substitute custom rotl function for
Long.rotateLeft.
This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git
commit 7f2d39b7d09be98ba9ffe17e7ebfa2ad31c00438
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Oct 21 17:17:17 2019 +0100
Substitute custom rotl function for Long.rotateLeft.
---
.../java/org/apache/commons/rng/core/source64/TwoCmres.java | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/TwoCmres.java b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/TwoCmres.java
index 6c50d03..c9c633f 100644
--- a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/TwoCmres.java
+++ b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/TwoCmres.java
@@ -223,19 +223,11 @@ public class TwoCmres extends LongProvider {
long transform(long state) {
long s = state;
s *= multiply;
- s = rotl(s);
+ s = Long.rotateLeft(s, rotate);
s -= state;
return s;
}
- /**
- * @param state State.
- * @return the rotated state.
- */
- private long rotl(long state) {
- return (state << rotate) | (state >>> (64 - rotate));
- }
-
/** Factory. */
static class Factory {
/** List of good "Cmres" subcycle generators. */