File tree Expand file tree Collapse file tree
jmh/java/org/hyperledger/besu/evm
main/java/org/hyperledger/besu/evm Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 * SPDX-License-Identifier: Apache-2.0
1414 */
1515package org .hyperledger .besu .ethereum .vm .operations ;
16+
1617import org .hyperledger .besu .evm .UInt256 ;
1718
18- import java .util .Random ;
19- import java .util .concurrent .TimeUnit ;
2019import java .util .concurrent .ThreadLocalRandom ;
20+ import java .util .concurrent .TimeUnit ;
2121
2222import org .openjdk .jmh .annotations .Benchmark ;
2323import org .openjdk .jmh .annotations .BenchmarkMode ;
3232import org .openjdk .jmh .annotations .Warmup ;
3333import org .openjdk .jmh .infra .Blackhole ;
3434
35-
3635@ State (Scope .Thread )
3736@ Warmup (iterations = 5 , time = 1 , timeUnit = TimeUnit .SECONDS )
3837@ Measurement (iterations = 5 , time = 1 , timeUnit = TimeUnit .SECONDS )
@@ -85,7 +84,6 @@ public enum Case {
8584 "SIZE_RAND_PAD_0" ,
8685 "SIZE_RAND_PAD_RAND"
8786 })
88-
8987 private String caseName ;
9088
9189 @ Setup (Level .Iteration )
@@ -117,4 +115,3 @@ public void fromBytesBE(final Blackhole blackhole) {
117115 index = (index + 1 ) % SAMPLE_SIZE ;
118116 }
119117}
120-
Original file line number Diff line number Diff line change @@ -102,13 +102,13 @@ int[] limbs() {
102102 * @return Big-endian UInt256 represented by the bytes.
103103 */
104104 public static UInt256 fromBytesBE (final byte [] bytes ) {
105- // Unchecked : bytes.length <= BYTESIZE
105+ // Unchecked : bytes.length <= BYTESIZE
106106 if (bytes .length == 0 ) return ZERO ;
107- int msb = Arrays .mismatch (bytes , ZERO_BYTES ); // Most significant byte index
107+ int msb = Arrays .mismatch (bytes , ZERO_BYTES ); // Most significant byte index
108108 if (msb == -1 || msb >= bytes .length ) return ZERO ;
109109 int [] limbs = new int [N_LIMBS ];
110- int i = N_LIMBS - 1 ; // Index in int array
111- int b = bytes .length - 1 ; // Index in bytes array
110+ int i = N_LIMBS - 1 ; // Index in int array
111+ int b = bytes .length - 1 ; // Index in bytes array
112112 int limb ;
113113 for (; b >= msb ; i --) {
114114 int shift = 0 ;
You can’t perform that action at this time.
0 commit comments