From 528de2849f6e31f45750b5276bec49123df03f58 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 8 Aug 2022 17:43:13 -0700 Subject: [PATCH] xmode.marker: caching match group regexps for performance --- basis/xmode/marker/marker.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/xmode/marker/marker.factor b/basis/xmode/marker/marker.factor index 05e93b6154..4ecfa9b796 100644 --- a/basis/xmode/marker/marker.factor +++ b/basis/xmode/marker/marker.factor @@ -102,7 +102,7 @@ M: regexp text-matches? : match-group-regexp ( regexp n -- skip-regexp match-regexp ) [ [ options>> options>string ] [ raw>> ] bi ] dip CHAR: ( pick nth-index cut CHAR: ) over index 1 + head - rot '[ _ ] bi@ ; + rot '[ H{ } [ _ ] cache ] bi@ ; : skip-first-match ( match regexp -- tailseq ) first-match [ seq>> ] [ to>> ] bi tail ; -- 2.34.1