From d7a42641ab66c3f785f179fe86846c3c92cb9739 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Fri, 3 Apr 2015 23:21:19 +0800 Subject: [PATCH] compiler_ropes: remove unnecessary length check frmt[frmt.len] isn't an out-of-bounds access for strings (!) --- compiler/ropes.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/ropes.nim b/compiler/ropes.nim index 194b52bb20..160b1a4c6e 100644 --- a/compiler/ropes.nim +++ b/compiler/ropes.nim @@ -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))