From 5e06dea15f8bc28319d8f588a8607cf70e404bbc Mon Sep 17 00:00:00 2001 From: dzaima Date: Mon, 26 May 2025 23:45:20 +0300 Subject: [PATCH] optimize WRAP --- src/core/stuff.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/stuff.h b/src/core/stuff.h index 2a9f3e3b..35b03f26 100644 --- a/src/core/stuff.h +++ b/src/core/stuff.h @@ -64,7 +64,7 @@ extern INIT_GLOBAL M_FillF fillFns[el_MAX]; #define TYARR_SZ2(T,IA) TYARR_SZ(T,IA) #define TYARR_SZW(W,IA) (offsetof(TyArr, a) + (W)*(IA)) -#define WRAP(X,IA,MSG) ({ i64 wV=(i64)(X); u64 iaW=(IA); if(RARE((u64)wV >= iaW)) { if(wV<0) wV+= iaW; if((u64)wV >= iaW) {MSG;} }; (usz)wV; }) +#define WRAP(X,IA,MSG) ({ i64 wV=(i64)(X); u64 iaW=(IA); if(RARE((u64)wV >= iaW)) { wV+= iaW; if(RARE((u64)wV >= iaW)) {MSG;} }; (usz)wV; }) static void tyarrv_freeP(Arr* x) { assert(PRNK(x)<=1 && IS_DIRECT_TYARR(PTY(x))); mm_free((Value*)x); } static void tyarrv_free(B x) { tyarrv_freeP(a(x)); }