Permalink
Browse files

. shortcuts for speeding up the line counting

  • Loading branch information...
1 parent 5fbe644 commit d4b39cb3d748ae743dc240ec384a316b7de27402 @kschiess committed Feb 4, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/parslet/source.rb
View
@@ -99,6 +99,8 @@ def lbound(bound)
private
def scan_for_line_endings(start_pos, buf)
+ return unless buf
+ return unless buf.index("\n")
cur = -1
# If we have already read part or all of buf, we already know about

0 comments on commit d4b39cb

Please sign in to comment.