Skip to content

Commit f2db2ca

Browse files
committed
use Long.expand
1 parent 9746308 commit f2db2ca

File tree

1 file changed

+1
-6
lines changed
  • src/java.base/share/classes/java/util

1 file changed

+1
-6
lines changed

src/java.base/share/classes/java/util/UUID.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -486,12 +486,7 @@ public String toString() {
486486
}
487487

488488
private static void putHex8(byte[] bytes, int off, long i, boolean separator) {
489-
// Long.expand(i, 0x0F0F_0F0F_0F0F_0F0FL)
490-
long e = i & 0xF;
491-
for (int x = 4; x < 64; x += 4) {
492-
e |= ((i & (0xFL << x)) << x);
493-
}
494-
489+
long e = Long.expand(i, 0x0F0F_0F0F_0F0F_0F0FL);
495490
/*
496491
Use long to simulate vector operations and generate 8 hexadecimal characters at a time.
497492
------------

0 commit comments

Comments
 (0)