summary refs log tree commit diff stats
path: root/lib/std/packedsets.nim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-01-29 05:30:24 -0800
committerGitHub <noreply@github.com>2021-01-29 14:30:24 +0100
commit6e267d28b3459aa447cae07ba61209438977cd5c (patch)
tree897e3f491a9b3361e888256b7c8df4ccc8bccf64 /lib/std/packedsets.nim
parent4e1e231e29491b856ed55c79712201a4843f9854 (diff)
downloadNim-6e267d28b3459aa447cae07ba61209438977cd5c.tar.gz
remove conditionals on nimHasUserErrors, nimNoNilSeqs2, nimNoNilSeqs (#16861)
* cleanup docs for type(nil) | type(nil); simplify nimHasUserErrors

* simplify nimNoNilSeqs2

* simplify nimNoNilSeqs

* fixup
Diffstat (limited to 'lib/std/packedsets.nim')
-rw-r--r--lib/std/packedsets.nim12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/std/packedsets.nim b/lib/std/packedsets.nim
index 42814547c..a5101ec37 100644
--- a/lib/std/packedsets.nim
+++ b/lib/std/packedsets.nim
@@ -180,7 +180,7 @@ proc initPackedSet*[A]: PackedSet[A] =
     counter: 0,
     max: 0,
     head: nil,
-    data: when defined(nimNoNilSeqs): @[] else: nil)
+    data: @[])
   #  a: array[0..33, int] # profiling shows that 34 elements are enough
 
 proc contains*[A](s: PackedSet[A], key: A): bool =
@@ -392,10 +392,7 @@ proc clear*[A](result: var PackedSet[A]) =
   # setLen(result.data, InitIntSetSize)
   # for i in 0..InitIntSetSize - 1: result.data[i] = nil
   # result.max = InitIntSetSize - 1
-  when defined(nimNoNilSeqs):
-    result.data = @[]
-  else:
-    result.data = nil
+  result.data = @[]
   result.max = 0
   result.counter = 0
   result.head = nil
@@ -426,10 +423,7 @@ proc assign*[A](dest: var PackedSet[A], src: PackedSet[A]) =
     assert len(a) == 2
 
   if src.elems <= src.a.len:
-    when defined(nimNoNilSeqs):
-      dest.data = @[]
-    else:
-      dest.data = nil
+    dest.data = @[]
     dest.max = 0
     dest.counter = src.counter
     dest.head = nil