summary refs log tree commit diff stats
path: root/compiler/renderer.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-08-22 12:35:46 +0200
committerAraq <rumpf_a@web.de>2018-08-22 12:35:46 +0200
commit64517445ea2347f29d91de44fe46ff78a6f655ab (patch)
tree630493227c0d7c953da3b0af087615d1727829db /compiler/renderer.nim
parent9047c3f5821043a348e289335ff00b1147a34f88 (diff)
downloadNim-64517445ea2347f29d91de44fe46ff78a6f655ab.tar.gz
even more strict isNil handling for strings/seqs in order to detect bugs
Diffstat (limited to 'compiler/renderer.nim')
-rw-r--r--compiler/renderer.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/renderer.nim b/compiler/renderer.nim
index c3e151f5a..8a25d76e8 100644
--- a/compiler/renderer.nim
+++ b/compiler/renderer.nim
@@ -175,7 +175,7 @@ proc put(g: var TSrcGen, kind: TTokType, s: string) =
     g.pendingWhitespace = s.len
 
 proc putComment(g: var TSrcGen, s: string) =
-  if s.isNil: return
+  if s.len == 0: return
   var i = 0
   let hi = len(s) - 1
   var isCode = (len(s) >= 2) and (s[1] != ' ')
@@ -216,7 +216,7 @@ proc putComment(g: var TSrcGen, s: string) =
   optNL(g)
 
 proc maxLineLength(s: string): int =
-  if s.isNil: return 0
+  if s.len == 0: return 0
   var i = 0
   let hi = len(s) - 1
   var lineLen = 0