Re: RFR: 8305785: Avoid redundant HashMap.containsKey call in java.util.regex

2023-05-22 Thread Andrey Turbanov
On Mon, 3 Apr 2023 16:58:15 GMT, Andrey Turbanov wrote: > `Pattern.namedGroups` and `Matcher.namedGroups` contains only non-null > values. It means instead of separate `containsKey`+`get` calls, we can use > single `HashMap.get` call and then compare result with null. > Result code is a bit sim

Re: RFR: 8305785: Avoid redundant HashMap.containsKey call in java.util.regex

2023-05-17 Thread Jaikiran Pai
On Mon, 3 Apr 2023 16:58:15 GMT, Andrey Turbanov wrote: > `Pattern.namedGroups` and `Matcher.namedGroups` contains only non-null > values. It means instead of separate `containsKey`+`get` calls, we can use > single `HashMap.get` call and then compare result with null. > Result code is a bit sim

Re: RFR: 8305785: Avoid redundant HashMap.containsKey call in java.util.regex

2023-05-15 Thread Sergey Tsypanov
On Mon, 3 Apr 2023 16:58:15 GMT, Andrey Turbanov wrote: > `Pattern.namedGroups` and `Matcher.namedGroups` contains only non-null > values. It means instead of separate `containsKey`+`get` calls, we can use > single `HashMap.get` call and then compare result with null. > Result code is a bit sim

Re: RFR: 8305785: Avoid redundant HashMap.containsKey call in java.util.regex

2023-05-14 Thread Andrey Turbanov
On Mon, 3 Apr 2023 16:58:15 GMT, Andrey Turbanov wrote: > `Pattern.namedGroups` and `Matcher.namedGroups` contains only non-null > values. It means instead of separate `containsKey`+`get` calls, we can use > single `HashMap.get` call and then compare result with null. > Result code is a bit sim

Re: RFR: 8305785: Avoid redundant HashMap.containsKey call in java.util.regex

2023-04-16 Thread Sergey Tsypanov
On Mon, 3 Apr 2023 16:58:15 GMT, Andrey Turbanov wrote: > `Pattern.namedGroups` and `Matcher.namedGroups` contains only non-null > values. It means instead of separate `containsKey`+`get` calls, we can use > single `HashMap.get` call and then compare result with null. > Result code is a bit sim

RFR: 8305785: Avoid redundant HashMap.containsKey call in java.util.regex

2023-04-09 Thread Andrey Turbanov
`Pattern.namedGroups` and `Matcher.namedGroups` contains only non-null values. It means instead of separate `containsKey`+`get` calls, we can use single `HashMap.get` call and then compare result with null. Result code is a bit simpler and faster. - Commit messages: - 8305785: Avoi