From 3fa0463241461892050e41284824ff2227799d4a Mon Sep 17 00:00:00 2001 From: dzaima Date: Sun, 29 May 2022 14:03:15 +0300 Subject: [PATCH] manual eqShPart mainly to not suffer the cost of function invocation, as the common case is len==1 --- src/core/stuff.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/stuff.h b/src/core/stuff.h index 814a89ba..464551c6 100644 --- a/src/core/stuff.h +++ b/src/core/stuff.h @@ -90,7 +90,9 @@ static usz arr_csz(B x) { return r; } static bool eqShPart(usz* w, usz* x, usz len) { - return memcmp(w, x, len*sizeof(usz))==0; + // return memcmp(w, x, len*sizeof(usz))==0; + NOUNROLL for (i32 i = 0; i < len; i++) if (w[i]!=x[i]) return false; + return true; } static bool eqShape(B w, B x) { assert(isArr(w)); assert(isArr(x)); ur wr = rnk(w); usz* wsh = a(w)->sh;