diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-03-04 22:19:11 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-03-04 22:19:11 +0100 |
commit | 50d2a5868ae56c4034815ddd9f8cbaed02ec3e3d (patch) | |
tree | c92d3604130896b4e3a612521008d9a9d36eb776 | |
parent | 00c48612083a3ee3b54b61b40e277995fcd59323 (diff) | |
download | Nim-50d2a5868ae56c4034815ddd9f8cbaed02ec3e3d.tar.gz |
added intsets.clear proc
-rw-r--r-- | lib/pure/collections/intsets.nim | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/pure/collections/intsets.nim b/lib/pure/collections/intsets.nim index 603a4b595..4ecac11be 100644 --- a/lib/pure/collections/intsets.nim +++ b/lib/pure/collections/intsets.nim @@ -138,6 +138,13 @@ proc initIntSet*: IntSet = result.counter = 0 result.head = nil +proc clear*(result: var IntSet) = + setLen(result.data, InitIntSetSize) + for i in 0..InitIntSetSize-1: result.data[i] = nil + result.max = InitIntSetSize-1 + result.counter = 0 + result.head = nil + proc isNil*(x: IntSet): bool {.inline.} = x.head.isNil proc assign*(dest: var IntSet, src: IntSet) = |