You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Jan Hlavatý <hl...@code.cz> on 2004/09/01 07:17:52 UTC

[PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Removed unnecessary &'s (these are done automatically by conversion to byte).
Saves 32 bytecode instructions as well as several long constants in the classfile,
and should run a bit faster.


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

iQEUAwUBQTVbgHFDePgyse5HAQI8yQf42ETD0IDcjG/lZOHoF/nc3idA1z1duOUX
EITGEQn78vii7G8jYqCli2Hqj9OscA3uSTw+RnfOwFFMZTEV9UnbM4r+BRzZVAEe
QfAcRMHDx0H65SjCk5YKf69BgfTEEc5KjvWMYJLwIGz6PxNWpJPpYk3yVoMfByrr
3iM65Gazi/+dV8YhTu+XAIoYGi/i2o2lkWfLQu7Jh0S1sTuua5CQF16DdWC18CAz
+zwOsKGX4smNk/o0HdkGDqHsFuLmw8x5ewYMXSPh9/50Bd5hYrX7B5iRv3VoqPLp
GgB0mu8ro8XoGpsx9pIqUngwY1nmoNlB9HZj1Dq/MMGjLB31SDc1
=eovL
-----END PGP SIGNATURE-----

Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by Jan Hlavatý <hl...@code.cz>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel John Debrunner wrote:
| Jan Hlavatý wrote:
|
| | Removed unnecessary &'s (these are done automatically by conversion to
| | byte).
| | Saves 32 bytecode instructions as well as several long constants in the
| | classfile,
| | and should run a bit faster.
|
| I think you are correct, but I also have a very vague memory of some
| issues if we didn't use the &'s.

There are issues with sign extension when doing it the other way around
(stuffing bytes to int/long) - thats when you need ands. Maybe thats what is haunting you ;)

| I know this is early code and we
| (Cloudscape engineers) were following the examples from Sun, e.g. look
| at this extract from the Javadoc for java.io.DataOutput.writeShort.
|
| http://java.sun.com/j2se/1.4.2/docs/api/java/io/DataOutput.html#writeShort(int)
|
|
| The byte values to be written, in the order shown, are:
|
| ~ (byte)(0xff & (v >> 8))
| ~ (byte)(0xff & v)

Well I can't make any sense of it... why the hell would they and with 0xff?
Do they have bytes larger than 8 bits or something ;)
Or maybe its just braindead code ;)

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

iQEVAwUBQTYgHHFDePgyse5HAQKqIAgAjaX+pm6t0iXzOod4pHI0sySh8FqdIML+
luTRpPqAjLaHT6L6+xPh210J2KRn3ASUpIpch0DruY3NKsBkk38DMQ9wjevh6imq
7/ahWtSe1ISPstYjFxBRwavJF4uK412TsW5sJ4NhIZGMSnvq8JGQPfNvAKRqCxEZ
nkbAsy1ADcHpQtYhSDiMv97rNGWmBqbsBP2QaTcJrciWHjdJxh4/z+JM5jtshefa
/SuCvYcnkU6puw+jVBIfV+hf96WETQ8bzatMA/nw23VSHH0YUT4YYDs+aiCfYKce
2yf/4anxPSGWS5Y+5i0YIF7cc1xGtt3fCKN8NSI3aBEdAY0qkZfnmA==
=SnyD
-----END PGP SIGNATURE-----

Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jan Hlavatý wrote:

| Removed unnecessary &'s (these are done automatically by conversion to
| byte).
| Saves 32 bytecode instructions as well as several long constants in the
| classfile,
| and should run a bit faster.

I think you are correct, but I also have a very vague memory of some
issues if we didn't use the &'s. I know this is early code and we
(Cloudscape engineers) were following the examples from Sun, e.g. look
at this extract from the Javadoc for java.io.DataOutput.writeShort.

http://java.sun.com/j2se/1.4.2/docs/api/java/io/DataOutput.html#writeShort(int)

The byte values to be written, in the order shown, are:

~ (byte)(0xff & (v >> 8))
~ (byte)(0xff & v)

Dan.


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

iD8DBQFBNfrKIv0S4qsbfuQRAgVkAKDLob2gjWID15pA+5EDY2UapwnmKQCfY8A0
60q99HbIUfJfOSr5DJOxSaQ=
=lOO5
-----END PGP SIGNATURE-----


Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Patch applied as svn commit 47319

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

iD8DBQFBWFC4Iv0S4qsbfuQRAliiAJ9Z82u83snEr+m3cwrqChyyiW+nyACgmphQ
+ydSoVNU82ivz3WTFMpfNfY=
=PfRL
-----END PGP SIGNATURE-----


Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jan Hlavatý wrote:

> So, will this patch be applied?
>
> Jan
>

Yes, I will apply it soon. I first wanted to apply my change that stamps
built jar files with the svnversion number. Then with any subsequent
build anyone can figure out which changes it includes.

I was delaying the svnversion change until I saw there was no objection
to my e-mail with the subject 'Code changes going forward'. Just trying
to ensure that there is general agreement on how changes are made, and
that I'm not doing anything against the 'Apache Way', since I'm new to
all of this. Assuming no objections I'll apply the svnversion patch and
the uuid patch Monday.

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

iD8DBQFBVfxmIv0S4qsbfuQRAmYUAJwNxH+EKttCrc5+lVb2gHcxZfz0AQCgxC1e
9X4syLQK8YlPfTcERVoDryg=
=4ZDo
-----END PGP SIGNATURE-----


Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by Jan Hlavatý <hl...@code.cz>.
So, will this patch be applied?

Jan


Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by Jan Hlavatý <hl...@code.cz>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jan Hlavatý wrote:

> So, what is the correct way of attaching patches with Thunderbird/Enigmail?
> Which of the above will work best?

According to this http://nagoya.apache.org/eyebrowse/ReadMsg?listName=derby-dev@db.apache.org&msgNo=210 the PGP/MIME looks best for me ;)

Jan

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

iQEVAwUBQTkoH3FDePgyse5HAQJL1Af/Znk5qbAZ5xz+wgPJlA/KpzUEdzM/vG3/
JPeQ1FmkXDPhWp6dr05BdrHz/q9TRfc3p+K/lyIQzHFCS58ig4ssF181lWodoO6A
FDwCoMmldCvfITgK4mJzBJZS270oAV39Y5HxWFkappP/kebS9Xt9dJt0AqrHE+8v
lKsb9XziyRYI6cSglUy4NgNK09aZcPSnUA1S6JpT32pPM9+niBy1qKqhoB/c66pv
71jI/Dm3G+aTjZFidT16EfC61Eh258Q66lXCoSaKBu/548Gz8P1tw2oA5Q/RkdpV
Nqa+cE7rJqeRrs5ftSYw0USms/7J1TtUcc0+BziEaR9+Gs5mKrV42g==
=OaNJ
-----END PGP SIGNATURE-----

Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by Kathey Marsden <km...@Sourcery.Org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jan Hlavatý wrote:
| Daniel John Debrunner wrote:
|
|>>I could only get the attachment to work easily. I still haven't figured
|>>out the extra '- ', I seem to see it inconsistently. The last inline
|>>patch looked ok, but when I saved it from mozilla, it added the '- '.
|
|
| I figured that out, you have to use Enigmail/Save decrypted message
| to get the original text from inlined patches. That will remove the -
escapes.
|
| This will however not make the tildes go away - that must be handled
when sending,
| turning off option Enigmail/Preferences/Sending/Allow flowed text (RFC
2646).
|
| Maybe we could put this advice somewhere on website for people sending
patches.
|
| BTW - are commiter able to make changes to repository already? I cant see
| any development...
|
| Jan

Thanks Jan for the enigmail info.   In regard to your question,  not yet
for me #:(.


Kathey


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

iD8DBQFBPdZLG0h36bFmkocRAu1BAJ42qerdNWU8A7pbpyutpeojEmYlCQCgjN1e
3X2RVYqz0L7qzCFdVlU5e1Y=
=cxqd
-----END PGP SIGNATURE-----

Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by Jan Hlavatý <hl...@code.cz>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel John Debrunner wrote:
> I could only get the attachment to work easily. I still haven't figured
> out the extra '- ', I seem to see it inconsistently. The last inline
> patch looked ok, but when I saved it from mozilla, it added the '- '.

I figured that out, you have to use Enigmail/Save decrypted message
to get the original text from inlined patches. That will remove the - escapes.

This will however not make the tildes go away - that must be handled when sending,
turning off option Enigmail/Preferences/Sending/Allow flowed text (RFC 2646).

Maybe we could put this advice somewhere on website for people sending patches.

BTW - are commiter able to make changes to repository already? I cant see
any development...

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

iQEVAwUBQTrmaXFDePgyse5HAQJ07Qf9EdJATqmNWT+M0lcfjQM00Zm2zJdJXH/e
IZF+KSgmPdZCqiM229FFl6w1b1toTeQjWVy5cZ4mTfexcmY4Y68pnR5p7+ZbTF8Z
ii49KXW5xTMyrp1e/C9g6k1u/yPrMbK10w9I8tDOjxQsJ5uOQptCRdD6NFXF8fkW
zq4Z5AFyxq+ceCJoVoktCj3WQY2cpeiWpZMivDmTAwTWpqxZCUFz+b9bgqBxO8ZP
KnpUQb3a+hiuc+tezUKL61olhHmYX8HaAXPAYj9+z9lEHlBpu5gA5Gwp/HlQKmjs
Sx73x6o5N1UYc+78ezuBsFzoPuCNzuyjCKEPy4NdStamkGPdsstfzg==
=+xqy
-----END PGP SIGNATURE-----

Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jan Hlavatý wrote:

| So, what is the correct way of attaching patches with
Thunderbird/Enigmail?
| Which of the above will work best?
|
| Jan


I could only get the attachment to work easily. I still haven't figured
out the extra '- ', I seem to see it inconsistently. The last inline
patch looked ok, but when I saved it from mozilla, it added the '- '.


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

iD8DBQFBOSuUIv0S4qsbfuQRAlf9AJ9SdXOLhBnQRszW5bXkqT8Y8xUACACg0UcL
JcJ30vPPEFhn8oM3uCqk+AM=
=blCk
-----END PGP SIGNATURE-----


Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by Jan Hlavatý <hl...@code.cz>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

So, what is the correct way of attaching patches with Thunderbird/Enigmail?
Which of the above will work best?

Jan

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

iQEVAwUBQTknWXFDePgyse5HAQKtUQgAic4XCKe8GT9vMusMKD5yYgrZLkCVVHFP
pdpbWvKkLQhCGSeHIIGcaezNbneAHsA6AmyJGdvYNefl7ldVJtYA2KF96fnIaQ+B
akI01Tv6xZCnvikR060iL8tlTB9eYFzuD9lB5aC+w4sZEMrK15pyQ6Qq0cdZc5pS
93q09T4uqPmHgOif2k0U5+J1nYyU4qWW2i/6fnjo0+pmpGhQR0dw3K2sLiwvgS9e
ATFOCSasc9kS3av9Vng52Td+Gi3T2juzBB05tSC0EosofU+dg03Rn4PRXUJDwHRZ
rRU7FaA2v209+I3mxlQ0DJ5nPyoRQeVSxOklwroUxuy29CsbDgQYUA==
=BERF
-----END PGP SIGNATURE-----

Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by Jan Hlavatý <hl...@code.cz>.
Brian W. Fitzpatrick wrote:
> Not really.  :-)  See below.

Hmmm... I think we're required to post the patches inline in order for them to be signed.

If you use PGP-enabled mail reader, the - escapes should go away.
I can see it OK in thunderbird/enigmail now (while i saw the ~ in the previous version).

I'll try attaching it this time and see what happens ;)

Jan

Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by "Brian W. Fitzpatrick" <fi...@red-bean.com>.
On Sep 3, 2004, at 12:19 AM, Jan Hlavatý wrote:
> Jan Hlavatý wrote:
>> Ah! These tildes seem to have been added when I sent the mail...
>
> Is this better?

Not really.  :-)  See below.

> 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;

Your mailer still seems to be munging the patch--it's prefixing any  
line that starts with a '-' with '- '.

I strongly recommend attaching the patch as text/plain.

-Fitz


Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by Jan Hlavatý <hl...@code.cz>.
-----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-----

Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by Jan Hlavatý <hl...@code.cz>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel John Debrunner wrote:
| The other patches do not have tildes in front of unchanged lines.
| Jan, any idea where the tildes came from?

Ah! These tildes seem to have been added when I sent the mail... enigmail/thunderbird did it...
I'll try to avoid it somehow...

Jan

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

iQEVAwUBQTf9cHFDePgyse5HAQJ1FQgAhzJKvAZJTY4yruSilop1o+/9liIdwPE/
awWIZP0cykQ1AtlJTN/HvFcr/WA+CbyVWI1dNFfF+lmpeXFIr259hEn4vG+RWawZ
xklgcmZv7dgcWcLd/mJKQ54V2D9pmXaiS/qk+LrYYNTzH4KcwPqmhfkKVG1r2KFQ
ZRvz/uTRKpL7cQoJJiwlr9kNjjZ7zcilIvu9M2O674XVz9cduJ3ukfkA8EColk+b
IM/ehKQh+YGw1kI/8N7Z0k829gb0LLNKK+JhKHJNrFozaVKfiiVRoi7b+jFbsotj
YKO5rdw/FWX0JBhN5weOWhpSx5kMPSTZakTxksQOjfiEWhlL3rsSZg==
=qUda
-----END PGP SIGNATURE-----

Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray()

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jan Hlavatý wrote:

| Removed unnecessary &'s (these are done automatically by conversion to
| byte).
| Saves 32 bytecode instructions as well as several long constants in the
| classfile,
| and should run a bit faster.
|
|
| 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;
[remaining patch deleted to save space]

Can anyone get the original patch applied to the code?
Gnupatch rejects it with malformed patch at line 23, the tilde (~) seems
to throw it off. I tried replacing the tildes with spaces, tabs or
nothing, but then the patch is just rejected.

The other patches do not have tildes in front of unchanged lines.
Jan, any idea where the tildes came from?

Dan.



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

iD8DBQFBN7ciIv0S4qsbfuQRAtqBAJ9axySHoOwdlKKyyQpRMddOXZhAIgCfffmS
Ovw+BGQV41QUvr94AuG4TqE=
=xjkQ
-----END PGP SIGNATURE-----