compiler_ropes: remove unnecessary length check

frmt[frmt.len] isn't an out-of-bounds access for strings (!)
This commit is contained in:
Jacek Sieka
2015-04-03 23:21:19 +08:00
parent 71e785904b
commit d7a42641ab

View File

@@ -275,7 +275,7 @@ proc `%`*(frmt: TFormatStr, args: openArray[Rope]): Rope =
while true:
j = j * 10 + ord(frmt[i]) - ord('0')
inc(i)
if (i >= length) or frmt[i] notin {'0'..'9'}: break
if frmt[i] notin {'0'..'9'}: break
num = j
if j > high(args) + 1:
errorHandler(rInvalidFormatStr, $(j))