DescriptionIn theory String.indexOf would search the entire string, whereas we are only interested in the first two characters here. I tried three approaches: String.startsWith, Stirng.substring(0, 2) == "@@", and the [] operator. The last one is the fastest.
In practice this does not appear to make any significant difference in the performance of RegExpFilter.fromText, but maybe it's more visible on mobile and such.
Patch Set 1 #
MessagesTotal messages: 3
|