This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
'the oldest ASCII trick in the book'.
The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
latin1 bytes for equality ignoring case. `StringLatin1.regionMatchesCI` is
updated to use `equalsIgnoreCase
On Sat, 18 Feb 2023 09:21:25 GMT, Eirik Bjorsnos wrote:
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case.
On Sat, 18 Feb 2023 09:21:25 GMT, Eirik Bjorsnos wrote:
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case.
On Sat, 18 Feb 2023 19:04:24 GMT, David Schlosnagle wrote:
>> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
>> 'the oldest ASCII trick in the book'.
>>
>> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
>> latin1 bytes for equality ignori
On Sat, 18 Feb 2023 19:45:34 GMT, Eirik Bjorsnos wrote:
>> src/java.base/share/classes/java/lang/CharacterDataLatin1.java.template line
>> 181:
>>
>>> 179: return ( U <= 'Z' // In range A-Z
>>> 180: || (U >= 0xC0 && U <= 0XDE && U != 0xD7)) // ..or
>>> A-grave-Thorn,
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case. `StringLatin1.regionMatchesCI` is
> updated to use `equa
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case. `StringLatin1.regionMatchesCI` is
> updated to use `equa
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case. `StringLatin1.regionMatchesCI` is
> updated to use `equa
On Mon, 20 Feb 2023 14:45:09 GMT, Eirik Bjorsnos wrote:
>> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
>> 'the oldest ASCII trick in the book'.
>>
>> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
>> latin1 bytes for equality ignoring
On Mon, 20 Feb 2023 15:40:09 GMT, Claes Redestad wrote:
>> Eirik Bjorsnos has updated the pull request incrementally with two
>> additional commits since the last revision:
>>
>> - Add @bug tag to EqualsIgnoreCase test for correct issue JDK-8302871
>> - Add @bug tag to EqualsIgnoreCase test f
On Mon, 20 Feb 2023 16:16:45 GMT, Eirik Bjorsnos wrote:
>> src/java.base/share/classes/java/lang/CharacterDataLatin1.java.template line
>> 170:
>>
>>> 168: * @return true if the two bytes are considered equals ignoring
>>> case in latin1
>>> 169: */
>>> 170: static boolean equal
On Mon, 20 Feb 2023 16:23:32 GMT, Claes Redestad wrote:
>> Is it not already in CharacterDataLatin1?
>>
>> Here is a comparison of relying on improvements in
>> `CharacterDataLatin1.toUpperCase/toLowerCase` only vs. using
>> `CharacterDataLatin1.equalsIgnoreCase`:
>>
>> Character.toUpperCase/
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case. `StringLatin1.regionMatchesCI` is
> updated to use `equa
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case. `StringLatin1.regionMatchesCI` is
> updated to use `equa
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case. `StringLatin1.regionMatchesCI` is
> updated to use `equa
On Tue, 21 Feb 2023 11:14:13 GMT, Eirik Bjorsnos wrote:
>> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
>> 'the oldest ASCII trick in the book'.
>>
>> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
>> latin1 bytes for equality ignoring
On Tue, 21 Feb 2023 11:14:13 GMT, Eirik Bjorsnos wrote:
>> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
>> 'the oldest ASCII trick in the book'.
>>
>> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
>> latin1 bytes for equality ignoring
On Tue, 21 Feb 2023 14:27:03 GMT, Alan Bateman wrote:
>> Eirik Bjorsnos has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> Remove whitespace following '('
>
> src/java.base/share/classes/java/lang/CharacterDataLatin1.java.template line
> 1
On Tue, 21 Feb 2023 20:23:11 GMT, Eirik Bjorsnos wrote:
>> src/java.base/share/classes/java/lang/CharacterDataLatin1.java.template line
>> 175:
>>
>>> 173: }
>>> 174: // uppercase b1 using 'the oldest ASCII trick in the book'
>>> 175: int U = b1 & 0xDF;
>>
>> I'm sur
On Tue, 21 Feb 2023 20:33:41 GMT, Eirik Bjorsnos wrote:
>> Hi Alan,
>>
>> I thought I was clever by encoding the 'uppercaseness' in the variable name,
>> but yeah I'll find a better name :)
>>
>> There is some precedent for using the 'ASCII trick' comment in the JDK. I
>> found it in ZipFile
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case. `StringLatin1.regionMatchesCI` is
> updated to use `equa
On Tue, 21 Feb 2023 14:22:30 GMT, Alan Bateman wrote:
>> Eirik Bjorsnos has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> Remove whitespace following '('
>
> src/java.base/share/classes/java/lang/CharacterDataLatin1.java.template line
> 1
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case. `StringLatin1.regionMatchesCI` is
> updated to use `equa
On Tue, 21 Feb 2023 20:48:04 GMT, Martin Buchholz wrote:
>> Perhaps @Martin-Buchholz could chime in and also tell us which book he found
>> his ASCII trick in :)
>
> "oldest trick in the book" is a phrase that does not necessarily imply
> existence of an actual book!
>
> Let this evoke an imag
On Tue, 21 Feb 2023 23:20:03 GMT, Martin Buchholz wrote:
>> "oldest trick in the book" is a phrase that does not necessarily imply
>> existence of an actual book!
>>
>> Let this evoke an image of a **personal** book of tricks that programmers in
>> the 1960s might have recorded such techniques
On Tue, 21 Feb 2023 23:28:52 GMT, Eirik Bjorsnos wrote:
>> More to the point, ASCII was obviously **designed** to allow you to
>> uppercase a lower case letter with a single instruction, so "the book" might
>> have been a draft standard before they scrubbed out the interesting history!
>
> Than
On Wed, 22 Feb 2023 00:06:51 GMT, David Holmes wrote:
>> Thanks Martin, I will from now on envision a stack of dusty punch cards with
>> carefully scribbled notes on the back, barely held together with a dry and
>> cracked rubber band.
>>
>> More to the point: Do you have an opinion on the app
On Wed, 22 Feb 2023 00:45:52 GMT, Martin Buchholz wrote:
>> There are still some books on this :) but from wikipedia:
>>> during May 1963 the CCITT Working Party on the New Telegraph Alphabet
>>> proposed to assign lowercase characters to
>>> sticks[[a]](https://en.wikipedia.org/wiki/ASCII#cite
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case. `StringLatin1.regionMatchesCI` is
> updated to use `equa
On Wed, 22 Feb 2023 00:50:39 GMT, Martin Buchholz wrote:
>> More history: IIRC I originally used 'ASCII trick' when I was truly only
>> cared about ASCII, not Latin1 (e.g. ZipFile.isMetaName) and it's a slight
>> misnomer to use "ASCII" here. But Latin1 followed the precedent of ASCII.
>
>> Do
On Wed, 22 Feb 2023 07:11:16 GMT, Eirik Bjorsnos wrote:
>> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
>> 'the oldest ASCII trick in the book'.
>>
>> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
>> latin1 bytes for equality ignoring
On Wed, 22 Feb 2023 07:12:35 GMT, Eirik Bjorsnos wrote:
>>> Do you have an opinion on the appropriate level of documentation / comments
>>> for this kind of 'tricky' code?
>>
>> This code is not that tricky! And the proposed level of documentation is
>> excessive! A couple of lines of expla
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case. `StringLatin1.regionMatchesCI` is
> updated to use `equa
On Wed, 22 Feb 2023 07:11:16 GMT, Eirik Bjorsnos wrote:
>> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
>> 'the oldest ASCII trick in the book'.
>>
>> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
>> latin1 bytes for equality ignoring
On Wed, 22 Feb 2023 16:10:42 GMT, Martin Buchholz wrote:
>> Thanks Martin, David, Alan. This was instructive (and fun!)
>>
>> I suggest we condense the comment to something like this:
>>
>>
>> // Uppercase b1 by removing a single bit
>> int upper = b1 & 0xDF;
>> if (upper < 'A') {
>> retu
On Wed, 22 Feb 2023 16:25:41 GMT, Martin Buchholz wrote:
>> Eirik Bjorsnos has updated the pull request incrementally with two
>> additional commits since the last revision:
>>
>> - Replace 'oldest ASCII trick in the book' use in toUpperCase, toLowerCase
>> with "by removing (setting) a singl
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case. `StringLatin1.regionMatchesCI` is
> updated to use `equa
On Wed, 22 Feb 2023 16:37:45 GMT, Eirik Bjorsnos wrote:
>> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
>> 'the oldest ASCII trick in the book'.
>>
>> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
>> latin1 bytes for equality ignoring
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case. `StringLatin1.regionMatchesCI` is
> updated to use `equa
> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
> 'the oldest ASCII trick in the book'.
>
> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
> latin1 bytes for equality ignoring case. `StringLatin1.regionMatchesCI` is
> updated to use `equa
On Wed, 22 Feb 2023 20:01:52 GMT, Eirik Bjorsnos wrote:
>> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
>> 'the oldest ASCII trick in the book'.
>>
>> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
>> latin1 bytes for equality ignoring
On Thu, 23 Feb 2023 07:21:08 GMT, Eirik Bjorsnos wrote:
> Seems compatibility with existing 6-bit devices might have been the primary
> concern:
This also explains the placement of brackets, braces, bars, tilde etc. They
would look visually similar on 6-bit devices:
https://user-images.github
On Wed, 22 Feb 2023 18:44:57 GMT, Eirik Bjorsnos wrote:
> I'll let this linger a bit before integrating in case Alan has comments after
> the latest updates.
I plan to look at it, been busy with other things.
-
PR: https://git.openjdk.org/jdk/pull/12632
On Wed, 22 Feb 2023 20:01:52 GMT, Eirik Bjorsnos wrote:
>> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
>> 'the oldest ASCII trick in the book'.
>>
>> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
>> latin1 bytes for equality ignoring
On Wed, 22 Feb 2023 20:01:52 GMT, Eirik Bjorsnos wrote:
>> This PR suggests we can speed up `StringLatin1.regionMatchesCI` by applying
>> 'the oldest ASCII trick in the book'.
>>
>> The new static method `CharacterDataLatin1.equalsIgnoreCase` compares two
>> latin1 bytes for equality ignoring
45 matches
Mail list logo