From 43127455cb518bd21d4c5c2d63bcb62e4fbccdc9 Mon Sep 17 00:00:00 2001 From: Flaviu Tamas Date: Wed, 28 Jan 2015 20:19:35 -0500 Subject: Remove match cache --- src/nre.nim | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/nre.nim b/src/nre.nim index 6743a82dc..a8842b2da 100644 --- a/src/nre.nim +++ b/src/nre.nim @@ -27,7 +27,6 @@ type pcreMatchBounds: seq[Slice[cint]] ## First item is the bounds of the match ## Other items are the captures ## `a` is inclusive start, `b` is exclusive end - matchCache: seq[string] Captures* = distinct RegexMatch CaptureBounds* = distinct RegexMatch @@ -112,12 +111,7 @@ proc `[]`*(pattern: Captures, i: int): string = if bounds: let bounds = bounds.get - if pattern.matchCache == nil: - # capture count, plus the entire string - pattern.matchCache = newSeq[string](pattern.pattern.captureCount + 1) - if pattern.matchCache[i + 1] == nil: - pattern.matchCache[i + 1] = pattern.str.substr(bounds.a, bounds.b-1) - return pattern.matchCache[i + 1] + return pattern.str.substr(bounds.a, bounds.b-1) else: return nil -- cgit 1.4.1-2-gfad0 mary refs log tree commit diff stats
path: root/tests/objects/tobjcov.nim
blob: 8391727f2d0d445dd026bfc180543078413ffd96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17