db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Hlavatý <hla...@code.cz>
Subject Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()
Date Fri, 03 Sep 2004 05:19:15 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jan Hlavatý wrote:
> Ah! These tildes seem to have been added when I sent the mail...

Is this better?

Index: java/engine/org/apache/derby/impl/services/uuid/BasicUUID.java
===================================================================
- --- java/engine/org/apache/derby/impl/services/uuid/BasicUUID.java	(revision 37291)
+++ java/engine/org/apache/derby/impl/services/uuid/BasicUUID.java	(working copy)
@@ -279,26 +279,26 @@
 		byte[] result = new byte[16];

 		int lsequence = sequence;
- -		result[0] = (byte)((lsequence & 0xff000000) >>> 24);
- -		result[1] = (byte)((lsequence & 0x00ff0000) >>> 16);
- -		result[2] = (byte)((lsequence & 0x0000ff00) >>> 8);
- -		result[3] = (byte) (lsequence & 0x000000ff);
+		result[0] = (byte)(lsequence >>> 24);
+		result[1] = (byte)(lsequence >>> 16);
+		result[2] = (byte)(lsequence >>> 8);
+		result[3] = (byte)lsequence;

 		long ltimemillis = timemillis;
- -		result[4] = (byte)((ltimemillis & 0x0000ff0000000000L) >>> 40);
- -		result[5] = (byte)((ltimemillis & 0x000000ff00000000L) >>> 32);
- -		result[6] = (byte)((ltimemillis & 0x00000000ff000000L) >>> 24);
- -		result[7] = (byte)((ltimemillis & 0x0000000000ff0000L) >>> 16);
- - 		result[8] = (byte)((ltimemillis & 0x000000000000ff00L) >>> 8);
- -		result[9] = (byte) (ltimemillis & 0x00000000000000ffL);
+		result[4] = (byte)(ltimemillis >>> 40);
+		result[5] = (byte)(ltimemillis >>> 32);
+		result[6] = (byte)(ltimemillis >>> 24);
+		result[7] = (byte)(ltimemillis >>> 16);
+ 		result[8] = (byte)(ltimemillis >>> 8);
+		result[9] = (byte)ltimemillis;

 		long linetaddr = majorId;
- -		result[10] = (byte)((linetaddr & 0x0000ff0000000000L) >>> 40);
- -		result[11] = (byte)((linetaddr & 0x000000ff00000000L) >>> 32);
- -		result[12] = (byte)((linetaddr & 0x00000000ff000000L) >>> 24);
- -		result[13] = (byte)((linetaddr & 0x0000000000ff0000L) >>> 16);
- -		result[14] = (byte)((linetaddr & 0x000000000000ff00L) >>> 8);
- -		result[15] = (byte) (linetaddr & 0x00000000000000ffL);
+		result[10] = (byte)(linetaddr >>> 40);
+		result[11] = (byte)(linetaddr >>> 32);
+		result[12] = (byte)(linetaddr >>> 24);
+		result[13] = (byte)(linetaddr >>> 16);
+		result[14] = (byte)(linetaddr >>> 8);
+		result[15] = (byte)linetaddr;

 		return result;
 	}

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQEVAwUBQTf+0XFDePgyse5HAQJF7Af9H2WDpJN9YK5RPqM7ezm+mfS/zdUEgCFv
2J8GC9MfPTjRSXOHt3upuF7a427NUYY4+DIrTx8b/jNP/2vlSdIcHvPhGZZdYUbq
jW9Cjxez3rkEv2mlqZG8LQtVN3+8KZALw7+urgLiiWLX2bORigW3apFyse9uQ29g
hm3G5/8+BbvWsBeGzOCwIdaxqI/kxYJC7WYPqsMDQi1IlJDQ+RVCj51c3tR42orf
Je4z+zB+hu4PjrzLYiRDK9dAeSuceIRiDwjLIH1TyYrETOdXyLYgaum75xuRbDf2
Sfydd5zm3VB5YcXR7nJtVQLbV4pVDHU+dsiqvnqiZkEIvaYXrWdJfA==
=b6uf
-----END PGP SIGNATURE-----

Mime
View raw message