Avoids temporal string in tables hashing example.
This commit is contained in:
parent
7da3c5e71e
commit
9009841d62
1 changed files with 4 additions and 2 deletions
|
|
@ -37,7 +37,8 @@
|
||||||
## ## Piggyback on the already available string hash proc.
|
## ## Piggyback on the already available string hash proc.
|
||||||
## ##
|
## ##
|
||||||
## ## Without this proc nothing works!
|
## ## Without this proc nothing works!
|
||||||
## result = hash(x.firstName & x.lastName)
|
## result = x.firstName.hash !& x.lastName.hash
|
||||||
|
## result = !$result
|
||||||
##
|
##
|
||||||
## var
|
## var
|
||||||
## salaries = initTable[Person, int]()
|
## salaries = initTable[Person, int]()
|
||||||
|
|
@ -841,7 +842,8 @@ when isMainModule:
|
||||||
## Piggyback on the already available string hash proc.
|
## Piggyback on the already available string hash proc.
|
||||||
##
|
##
|
||||||
## Without this proc nothing works!
|
## Without this proc nothing works!
|
||||||
result = hash(x.firstName & x.lastName)
|
result = x.firstName.hash !& x.lastName.hash
|
||||||
|
result = !$result
|
||||||
|
|
||||||
var
|
var
|
||||||
salaries = initTable[Person, int]()
|
salaries = initTable[Person, int]()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue