File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ prelude : |
2
+ $LOAD_PATH.unshift(File.expand_path("lib"))
3
+ require "strscan"
4
+ str = "test string"
5
+ scanner = StringScanner.new(str)
6
+ str = "test"
7
+ reg = /test/
8
+ benchmark :
9
+ check(reg) : |
10
+ scanner.check(reg)
11
+ check(str) : |
12
+ scanner.check(str)
13
+ match?(reg) : |
14
+ scanner.match?(reg)
15
+ match?(str) : |
16
+ scanner.match?(str)
Original file line number Diff line number Diff line change
1
+ prelude : |
2
+ $LOAD_PATH.unshift(File.expand_path("lib"))
3
+ require "strscan"
4
+ str = "test string"
5
+ scanner = StringScanner.new(str)
6
+ str = "string"
7
+ reg = /string/
8
+ benchmark :
9
+ check_until(reg) : |
10
+ scanner.check_until(reg)
11
+ check_until(str) : |
12
+ scanner.check_until(str)
13
+ exist?(reg) : |
14
+ scanner.exist?(reg)
15
+ exist?(str) : |
16
+ scanner.exist?(str)
You can’t perform that action at this time.
0 commit comments