From 1cea42cad31a4c659ba76178f04539dbc4b92eb6 Mon Sep 17 00:00:00 2001 From: dzaima Date: Mon, 10 Jul 2023 16:49:50 +0300 Subject: [PATCH] =?UTF-8?q?use=20getter=20over=20=F0=9D=95=A8=20for=20gene?= =?UTF-8?q?ric=20=F0=9D=95=A8=E2=8D=8B=F0=9D=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit doesn't change perf, but leads to fast amortized long⍋short --- src/builtins/grade.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/builtins/grade.h b/src/builtins/grade.h index 7891bc53..7ff9efd9 100644 --- a/src/builtins/grade.h +++ b/src/builtins/grade.h @@ -541,17 +541,14 @@ B GRADE_CAT(c2)(B t, B w, B x) { gen:; #endif i32* rp; r = m_i32arrc(&rp, x); - - SGetU(x) SLOW2("𝕨"GRADE_CHR"𝕩", w, x); - B* wp = TO_BPTR(w); - + SGetU(w) SGetU(x) for (usz i = 0; i < xia; i++) { B c = GetU(x,i); usz s = 0, e = wia+1; while (e-s > 1) { usz m = (s+e) / 2; - if (compare(c, wp[m-1]) LT 0) e = m; + if (compare(c, GetU(w,m-1)) LT 0) e = m; else s = m; } rp[i] = s;