summary refs log tree commit diff stats
path: root/lib/pure/strtabs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pure/strtabs.nim')
-rw-r--r--lib/pure/strtabs.nim13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/pure/strtabs.nim b/lib/pure/strtabs.nim
index 3b90fea50..4b07aca5a 100644
--- a/lib/pure/strtabs.nim
+++ b/lib/pure/strtabs.nim
@@ -51,13 +51,17 @@ runnableExamples:
 import std/private/since
 
 import
-  hashes, strutils
+  std/[hashes, strutils]
+
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
 
 when defined(js) or defined(nimscript) or defined(Standalone):
   {.pragma: rtlFunc.}
 else:
   {.pragma: rtlFunc, rtl.}
-  import os
+  import std/envvars
 
 include "system/inclrtl"
 
@@ -257,10 +261,7 @@ proc newStringTable*(mode: StringTableMode): owned(StringTableRef) {.
   ## See also:
   ## * `newStringTable(keyValuePairs) proc
   ##   <#newStringTable,varargs[tuple[string,string]],StringTableMode>`_
-  new(result)
-  result.mode = mode
-  result.counter = 0
-  newSeq(result.data, startSize)
+  result = StringTableRef(mode: mode, counter: 0, data: newSeq[KeyValuePair](startSize))
 
 proc newStringTable*(keyValuePairs: varargs[string],
                      mode: StringTableMode): owned(StringTableRef) {.