From: John Benediktsson Date: Tue, 9 Aug 2022 00:43:13 +0000 (-0700) Subject: xmode.marker: caching match group regexps for performance X-Git-Tag: 0.99~1154 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=528de2849f6e31f45750b5276bec49123df03f58 xmode.marker: caching match group regexps for performance --- 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 ;