]> Cypherpunks repositories - gostls13.git/commit
two easy optimizations for regexp:
authorRob Pike <r@golang.org>
Fri, 20 Nov 2009 00:45:50 +0000 (16:45 -0800)
committerRob Pike <r@golang.org>
Fri, 20 Nov 2009 00:45:50 +0000 (16:45 -0800)
commita6e1ad27335968e468046786d1aebb0972280975
tree78379bfa4749732b84223442888b81c9d63a7937
parent398927e63b5952319caf4bcde0b4635f1bb2c6e3
two easy optimizations for regexp:
1) if char class contains a single character, make it a single character.
(this is used to quote, e.g. [.] rather than \.
2) if regexp begins with ordinary text substring, use plain string match to start engine

R=rsc
CC=golang-dev
https://golang.org/cl/157095
src/pkg/regexp/all_test.go
src/pkg/regexp/regexp.go