Integrated: 8305785: Avoid redundant HashMap.containsKey call in java.util.regex
Andrey Turbanov
aturbanov at openjdk.org
Mon May 22 10:30:59 UTC 2023
On Mon, 3 Apr 2023 16:58:15 GMT, Andrey Turbanov <aturbanov at openjdk.org> 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 simpler and faster.
This pull request has now been integrated.
Changeset: 6b65e575
Author: Andrey Turbanov <aturbanov at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/6b65e5754cc96c812892077881fc069e02fedc62
Stats: 10 lines in 2 files changed: 3 ins; 0 del; 7 mod
8305785: Avoid redundant HashMap.containsKey call in java.util.regex
Reviewed-by: stsypanov, jpai
-------------
PR: https://git.openjdk.org/jdk/pull/13303
More information about the core-libs-dev
mailing list