From 9009841d623d268c649f96bd0215b3013de35eeb Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Fri, 6 Jun 2014 19:53:39 +0200 Subject: [PATCH] Avoids temporal string in tables hashing example. --- lib/pure/collections/tables.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim index 848f4b8bae..b5fc1737ad 100644 --- a/lib/pure/collections/tables.nim +++ b/lib/pure/collections/tables.nim @@ -37,7 +37,8 @@ ## ## Piggyback on the already available string hash proc. ## ## ## ## Without this proc nothing works! -## result = hash(x.firstName & x.lastName) +## result = x.firstName.hash !& x.lastName.hash +## result = !$result ## ## var ## salaries = initTable[Person, int]() @@ -841,7 +842,8 @@ when isMainModule: ## Piggyback on the already available string hash proc. ## ## Without this proc nothing works! - result = hash(x.firstName & x.lastName) + result = x.firstName.hash !& x.lastName.hash + result = !$result var salaries = initTable[Person, int]()