diff options
-rw-r--r-- | lib/pure/strtabs.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pure/strtabs.nim b/lib/pure/strtabs.nim index 858043128..75c5e171d 100644 --- a/lib/pure/strtabs.nim +++ b/lib/pure/strtabs.nim @@ -138,6 +138,10 @@ proc hasKey*(t: StringTableRef, key: string): bool {.rtlFunc, extern: "nst$1".} ## returns true iff `key` is in the table `t`. result = rawGet(t, key) >= 0 +proc contains*(t: StringTableRef, key: string): bool = + ## alias of `hasKey` for use with the `in` operator. + return hasKey(t, key) + proc rawInsert(t: StringTableRef, data: var KeyValuePairSeq, key, val: string) = var h: Hash = myhash(t, key) and high(data) while not isNil(data[h].key): |