Fix broken logic in 7296c6d

Thanks @fowlmouth for pointing this problem out in IRC.
This commit is contained in:
Flaviu Tamas 2015-03-04 21:45:56 -05:00
commit e5e5970d93

View file

@ -175,10 +175,12 @@ proc `$`*(pattern: RegexMatch): string =
proc `==`*(a, b: Regex): bool = proc `==`*(a, b: Regex): bool =
# name-to-number table is generated at init time, doesn't need to be checked # name-to-number table is generated at init time, doesn't need to be checked
return not a.isNil and not b.isNil and if not a.isNil and not b.isNil:
a.pattern == b.pattern and return a.pattern == b.pattern and
a.pcreObj == b.pcreObj and a.pcreObj == b.pcreObj and
a.pcreExtra == b.pcreExtra a.pcreExtra == b.pcreExtra
else:
return system.`==`(a, b)
proc `==`*(a, b: RegexMatch): bool = proc `==`*(a, b: RegexMatch): bool =
# don't need to compare matchbounds, if pattern and str equal, everything # don't need to compare matchbounds, if pattern and str equal, everything