summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 25475c75b..3e8c17324 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -3266,4 +3266,9 @@ template `..<`*(a, b: expr): expr =
   ## '..' and '<' is required.
   a .. <b
 
+proc xlen*(x: string): int {.magic: "XLenStr", noSideEffect.}
+proc xlen*[T](x: seq[T]): int {.magic: "XLenSeq", noSideEffect.}
+  ## returns the length of a sequence or a string without testing for 'nil'.
+  ## This is an optimization that rarely makes sense.
+
 {.pop.} #{.push warning[GcMem]: off.}