File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
jmh/java/org/hyperledger/besu/evm
main/java/org/hyperledger/besu/evm Expand file tree Collapse file tree 2 files changed +6
-9
lines changed 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 @@ -87,13 +87,13 @@ int[] limbs() {
8787 * @return Big-endian UInt256 represented by the bytes.
8888 */
8989 public static UInt256 fromBytesBE (final byte [] bytes ) {
90- // Unchecked : bytes.length <= BYTESIZE
90+ // Unchecked : bytes.length <= BYTESIZE
9191 if (bytes .length == 0 ) return ZERO ;
92- int msb = Arrays .mismatch (bytes , ZERO_BYTES ); // Most significant byte index
92+ int msb = Arrays .mismatch (bytes , ZERO_BYTES ); // Most significant byte index
9393 if (msb == -1 || msb >= bytes .length ) return ZERO ;
9494 int [] limbs = new int [N_LIMBS ];
95- int i = N_LIMBS - 1 ; // Index in int array
96- int b = bytes .length - 1 ; // Index in bytes array
95+ int i = N_LIMBS - 1 ; // Index in int array
96+ int b = bytes .length - 1 ; // Index in bytes array
9797 int limb ;
9898 for (; b >= msb ; i --) {
9999 int shift = 0 ;
You can’t perform that action at this time.
0 commit comments