Skip to content

Commit

Permalink
ordset, prefix with std, intset cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
landerlo committed Oct 14, 2020
1 parent 336c77e commit 63687ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion lib/pure/collections/intsets.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
## * `ordinal sets module <ordsets.html>`_ for more general int sets

import std/private/since
import ordsets
import std/ordsets
export ordsets

type
IntSet* = OrdSet[int]

proc toIntSet*(x: openArray[int]): IntSet {.since: (1, 3), inline.} = toOrdSet[int](x)

proc initIntSet*(): IntSet {.inline.} = initOrdSet[int]()
Expand Down
1 change: 0 additions & 1 deletion lib/pure/collections/ordsets.nim
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ type
data: TrunkSeq
a: array[0..33, int] # profiling shows that 34 elements are enough

IntSet* = OrdSet[int]

proc mustRehash[T](t: T): bool {.inline.} =
let length = t.max + 1
Expand Down
4 changes: 2 additions & 2 deletions tests/stdlib/tordsets.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ordsets
import std/ordsets
import std/sets

from sequtils import toSeq
Expand Down Expand Up @@ -65,7 +65,7 @@ block: # we use HashSet as groundtruth, it's well tested elsewhere
# issue #13505
doAssert t.missingOrExcl(`A`(i))

var t: IntSet
var t: OrdSet[int]
var t0: HashSet[int]
testDel(int, t, t0)

Expand Down

0 comments on commit 63687ac

Please sign in to comment.