From c6399b4c43b15b5c20dd38e9c83758f006bebd93 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 4 Mar 2017 00:32:32 -0800 Subject: [PATCH] Move substring? to be near its relatives. --- src/runtime/ustring.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/runtime/ustring.scm b/src/runtime/ustring.scm index a71dadc86..85e3aba56 100644 --- a/src/runtime/ustring.scm +++ b/src/runtime/ustring.scm @@ -962,6 +962,11 @@ USA. (string-matcher 'string-search-all %dumb-string-search-all)) +(define (substring? pattern text) + (and (or (fix:= 0 (string-length pattern)) + (string-search-forward pattern text)) + #t)) + (define (%dumb-string-search-forward pattern pend text tstart tlast) (let find-match ((tindex tstart)) (and (fix:<= tindex tlast) @@ -1467,11 +1472,6 @@ USA. (define substring-find-previous-char-in-set (substring-find-maker string-find-previous-char-in-set)) - -(define (substring? pattern text) - (and (or (fix:= 0 (string-length pattern)) - (string-search-forward pattern text)) - #t)) (define (string-move! string1 string2 start2) (string-copy! string2 start2 string1)) -- 2.25.1