diff options
author | Xavier Noria <fxn@hashref.com> | 2012-08-25 02:56:55 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2012-08-25 02:56:59 +0200 |
commit | 148e33058cf4b8c6197bdc8c78b28bfd018d051f (patch) | |
tree | 297d001eb14268b362855efc68eca4526028cadb /activesupport/test/benchmarkable_test.rb | |
parent | 9cbb6d2b20a8e3352bedd791fafe3c58f8bef328 (diff) | |
download | rails-148e33058cf4b8c6197bdc8c78b28bfd018d051f.tar.gz rails-148e33058cf4b8c6197bdc8c78b28bfd018d051f.tar.bz2 rails-148e33058cf4b8c6197bdc8c78b28bfd018d051f.zip |
simplifies a regexp
We simplify two things here: First since * is greedy it is enough to go
look for the rightmost ::, no need to ask the regexp engine to match the
rest of the string since we are not validating anything, only capturing.
The second simplification comes from using a look-ahead assertion, that
allows us to have the capture in $&, thus removing the need of a group.
Diffstat (limited to 'activesupport/test/benchmarkable_test.rb')
0 files changed, 0 insertions, 0 deletions