perf(rpc-actor): linear contains-text? via string-contains (P2)
ober
b308ff3bcaf96a901707ca8ffed80a239c49d08a
--- a/signal/rpc-actor.ss +++ b/signal/rpc-actor.ss @@ -244,14 +244,7 @@ (contains-text? line "Failed"))) (def (contains-text? text needle) - (let ([n (string-length text)] - [m (string-length needle)]) - (let loop ([i 0]) - (cond - [(= m 0) #t] - [(> (+ i m) n) #f] - [(string=? (substring text i (+ i m)) needle) #t] - [else (loop (+ i 1))])))) + (and (string-contains text needle) #t)) (def (mark-closed! actor reason) (let ([first-close?