nvoyé: Mardi 24 Avril 2018 14:17:21
> Objet: Re: [PATCH] minor regex cleanup: use switch for enum
> On 04/24/2018 12:41 PM, Peter Levart wrote:
>> public class Code {l
>>
>> static class m$switch$1 {
>> static final int[] caseindex = new in
), so if this is true, all fields
of java.lang should be trusted by the VM.
regards,
Rémi
- Mail original -
> De: "Peter Levart"
> À: "David Lloyd" , "Xueming Shen"
>
> Cc: "core-libs-dev"
> Envoyé: Mardi 24 Avril 2018 14:17:21
&
On Mon, Apr 23, 2018 at 7:42 PM, Isaac Levy wrote:
> On Mon, Apr 23, 2018 at 5:18 PM David Lloyd wrote:
>>
>> FWIW I strongly doubt this will improve performance; probably the
>> opposite in fact, as IIRC an enum switch generates an extra class
>> (though perhaps this has changed). The original
On 04/24/2018 12:41 PM, Peter Levart wrote:
public class Code {l
static class m$switch$1 {
static final int[] caseindex = new int[X.values().length];
static {
caseindex[X.A.ordinal()] = 1;
caseindex[X.B.ordinal()] = 2;
caseindex[X.C.ordin
On 04/23/2018 11:18 PM, David Lloyd wrote:
FWIW I strongly doubt this will improve performance; probably the
opposite in fact, as IIRC an enum switch generates an extra class
(though perhaps this has changed).
switch on enum is basically a switch on Enum's ordinal mapped via the
int[] array
On Mon, Apr 23, 2018 at 5:05 PM Xueming Shen
wrote:
>
> I would assume in case of an exception thrown from
> appendExpandedReplacement() we don't
> want "text" to be pushed into the "sb".
>
> -sherman
>
Perhaps. Though the behavior under exception is undefined and this function
is probably prima
On Mon, Apr 23, 2018 at 5:18 PM David Lloyd wrote:
> FWIW I strongly doubt this will improve performance; probably the
> opposite in fact, as IIRC an enum switch generates an extra class
> (though perhaps this has changed). The original code was quite
> compact and utilized identity comparisons,
FWIW I strongly doubt this will improve performance; probably the
opposite in fact, as IIRC an enum switch generates an extra class
(though perhaps this has changed). The original code was quite
compact and utilized identity comparisons, and given there are only
three alternatives it probably was
I would assume in case of an exception thrown from
appendExpandedReplacement() we don't
want "text" to be pushed into the "sb".
-sherman
On 4/23/18, 1:49 PM, Isaac Levy wrote:
Thanks. Another small perf patch below -- maybe we can combine. Avoids
a StringBuilder allocation:
--- a/src/java.
Thanks. Another small perf patch below -- maybe we can combine. Avoids a
StringBuilder allocation:
--- a/src/java.base/share/classes/java/util/regex/Matcher.java
+++ b/src/java.base/share/classes/java/util/regex/Matcher.java
@@ -993,13 +993,11 @@
public Matcher appendReplacement(StringBuilder
this looks fine.
-sherman
On 4/23/18, 12:26 PM, Isaac Levy wrote:
ping?
Isaac
On Wed, Apr 18, 2018 at 2:58 PM, Isaac Levy wrote:
Hi,
Minor improvement in readability (and probably perf) for Pattern. Switch
is more consistent with the rest of the impl and the resulting tableswitch
avoids
ping?
Isaac
On Wed, Apr 18, 2018 at 2:58 PM, Isaac Levy wrote:
> Hi,
>
> Minor improvement in readability (and probably perf) for Pattern. Switch
> is more consistent with the rest of the impl and the resulting tableswitch
> avoids a comparison for possessives.
>
> -Isaac
>
> --- a/src/java.ba
Hi,
Minor improvement in readability (and probably perf) for Pattern. Switch is
more consistent with the rest of the impl and the resulting tableswitch
avoids a comparison for possessives.
-Isaac
--- a/src/java.base/share/classes/java/util/regex/Pattern.java
+++ b/src/java.base/share/classes/jav
13 matches
Mail list logo