summary refs log tree commit diff stats
path: root/lib/pure/collections/tables.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-08-07 21:28:45 +0200
committerAraq <rumpf_a@web.de>2015-08-07 21:28:45 +0200
commitc733b3181ea21144fe485a5af3c78543a45d0564 (patch)
treeb142d42ff0057fe0104fc698022424ecd60b8954 /lib/pure/collections/tables.nim
parent2e4b59f3d3fc1ac99601988a482bad86a7ef7f53 (diff)
downloadNim-c733b3181ea21144fe485a5af3c78543a45d0564.tar.gz
breaking change: symbol lookups in generics follows spec more closely; fixes #2664
Diffstat (limited to 'lib/pure/collections/tables.nim')
-rw-r--r--lib/pure/collections/tables.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim
index ec0d9623f..be6b755ed 100644
--- a/lib/pure/collections/tables.nim
+++ b/lib/pure/collections/tables.nim
@@ -226,6 +226,10 @@ proc `$`*[A, B](t: Table[A, B]): string =
   ## The `$` operator for hash tables.
   dollarImpl()
 
+proc hasKey*[A, B](t: TableRef[A, B], key: A): bool =
+  ## returns true iff `key` is in the table `t`.
+  result = t[].hasKey(key)
+
 template equalsImpl() =
   if s.counter == t.counter:
     # different insertion orders mean different 'data' seqs, so we have
@@ -293,10 +297,6 @@ proc hasKeyOrPut*[A, B](t: var TableRef[A, B], key: A, val: B): bool =
   ## returns true iff `key` is in the table, otherwise inserts `value`.
   t[].hasKeyOrPut(key, val)
 
-proc hasKey*[A, B](t: TableRef[A, B], key: A): bool =
-  ## returns true iff `key` is in the table `t`.
-  result = t[].hasKey(key)
-
 proc contains*[A, B](t: TableRef[A, B], key: A): bool =
   ## alias of `hasKey` for use with the `in` operator.
   return hasKey[A, B](t, key)