-
Enhancement
-
Resolution: Fixed
-
P5
-
None
-
b24
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.
Affected methods:
1. java.util.regex.Matcher#getMatchedGroupIndex
2. java.util.regex.Pattern#escape
3. java.util.regex.Matcher#appendExpandedReplacement
Result code is a bit simpler and faster.
Affected methods:
1. java.util.regex.Matcher#getMatchedGroupIndex
2. java.util.regex.Pattern#escape
3. java.util.regex.Matcher#appendExpandedReplacement