mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 03:32:32 +00:00
Avoids temporal string in tables hashing example.
This commit is contained in:
@@ -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]()
|
||||
|
||||
Reference in New Issue
Block a user