From 3c4abacba67830f368f0d22de796a9b531044a15 Mon Sep 17 00:00:00 2001 From: data-man Date: Wed, 6 May 2020 17:08:49 +0500 Subject: [PATCH] Optimization of vectors hashing --- lib/std/hash/auto_hash.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/std/hash/auto_hash.zig b/lib/std/hash/auto_hash.zig index 70c858098d..a33b23354b 100644 --- a/lib/std/hash/auto_hash.zig +++ b/lib/std/hash/auto_hash.zig @@ -113,11 +113,9 @@ pub fn hash(hasher: var, key: var, comptime strat: HashStrategy) void { hasher.update(mem.asBytes(&key)); } else { // Otherwise, hash every element. - // TODO remove the copy to an array once field access is done. - const array: [info.len]info.child = key; comptime var i = 0; inline while (i < info.len) : (i += 1) { - hash(hasher, array[i], strat); + hash(hasher, key[i], strat); } } },