hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 187426a322cc9db5d49f35a162890a5f20d76fbc
parent 1422d86a168910fc0f6a2c6ba2da2d9fdc36d3f1
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sat, 14 May 2022 22:46:18 -0400

encoding::json: use fnv::string instead of fnv::string64

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mencoding/json/value.ha | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/encoding/json/value.ha b/encoding/json/value.ha @@ -22,7 +22,7 @@ export fn newobject() object = { // Gets a value from a JSON object. The return value is borrowed from the // object. export fn get(obj: *object, key: str) (*value | void) = { - const hash = fnv::string64(key): size; + const hash = fnv::string(key); const bucket = &obj.buckets[hash % len(obj.buckets)]; for (let i = 0z; i < len(bucket); i += 1) { if (bucket[i].0 == key) { @@ -33,7 +33,7 @@ export fn get(obj: *object, key: str) (*value | void) = { // Sets a value in a JSON object. export fn set(obj: *object, key: const str, val: const value) void = { - const hash = fnv::string64(key): size; + const hash = fnv::string(key); const bucket = &obj.buckets[hash % len(obj.buckets)]; for (let i = 0z; i < len(bucket); i += 1) { if (bucket[i].0 == key) { @@ -47,7 +47,7 @@ export fn set(obj: *object, key: const str, val: const value) void = { // Deletes a value from a JSON object. export fn del(obj: *object, key: const str) void = { - const hash = fnv::string64(key): size; + const hash = fnv::string(key); const bucket = &obj.buckets[hash % len(obj.buckets)]; for (let i = 0z; i < len(bucket); i += 1) { if (bucket[i].0 == key) {