Pre Merge pull request !269 from runphp/N/A

pull/269/MERGE
runphp 7 months ago committed by Gitee
commit b88f81caea
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -355,13 +355,13 @@ public final class UUID implements java.io.Serializable, Comparable<UUID>
} }
// time_high_and_version // time_high_and_version
builder.append(digits(mostSigBits, 4)); builder.append(digits(mostSigBits, 4));
if (false == isSimple) if (!isSimple)
{ {
builder.append('-'); builder.append('-');
} }
// variant_and_sequence // variant_and_sequence
builder.append(digits(leastSigBits >> 48, 4)); builder.append(digits(leastSigBits >> 48, 4));
if (false == isSimple) if (!isSimple)
{ {
builder.append('-'); builder.append('-');
} }
@ -419,13 +419,9 @@ public final class UUID implements java.io.Serializable, Comparable<UUID>
@Override @Override
public int compareTo(UUID val) public int compareTo(UUID val)
{ {
// The ordering is intentionally set up so that the UUIDs
// can simply be numerically compared as two numbers
return (this.mostSigBits < val.mostSigBits ? -1 : // return (this.mostSigBits < val.mostSigBits ? -1 : //
(this.mostSigBits > val.mostSigBits ? 1 : // (this.mostSigBits > val.mostSigBits ? 1 : //
(this.leastSigBits < val.leastSigBits ? -1 : // (Long.compare(this.leastSigBits, val.leastSigBits))));
(this.leastSigBits > val.leastSigBits ? 1 : //
0))));
} }
// ------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------

Loading…
Cancel
Save