Created
February 25, 2011 03:51
-
-
Save rubychan/843336 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/strscan.rb b/lib/strscan.rb | |
index 3908bfb..b2ac46c 100644 | |
--- a/lib/strscan.rb | |
+++ b/lib/strscan.rb | |
@@ -161,7 +161,7 @@ class StringScanner | |
end | |
def rest | |
- @string[pos..-1] | |
+ @string.substring(@pos, rest_size) | |
end | |
def rest? | |
@@ -169,7 +169,7 @@ class StringScanner | |
end | |
def rest_size | |
- rest.size | |
+ @string.size - @pos | |
end | |
def restsize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment