1
0
mirror of https://github.com/golang/go synced 2024-11-25 00:07:56 -07:00

comment func calcFlagsI

This commit is contained in:
func25 2024-09-06 16:03:08 +07:00
parent d73ed17748
commit fde024351e
No known key found for this signature in database
GPG Key ID: 746D8D0E266CD0E5

View File

@ -210,6 +210,8 @@ func calcFlags(re *Regexp, flags *map[*Regexp]printFlags) (must, cant printFlags
}
}
// calcFlagsI determines if the case-folding flag (?i) is required for character classes.
// It checks whether to look inside or outside character ranges for case folding, depending on which range is smaller, to minimize unnecessary checks.
func calcFlagsI(re *Regexp) (must, cant printFlags) {
if len(re.Rune) < 2 {
return 0, 0