adjust find-string in text% so it doesn't allocate as many temporary strings
Also, Rackety
This commit is contained in:
parent
3fc8ce0709
commit
1298c11d2f
|
@ -3592,7 +3592,7 @@
|
||||||
s)])
|
s)])
|
||||||
(vector-set! smap i s)
|
(vector-set! smap i s)
|
||||||
(loop s (+ i direction)))))))
|
(loop s (+ i direction)))))))
|
||||||
|
(define text "")
|
||||||
(let a-loop ([s beyond]
|
(let a-loop ([s beyond]
|
||||||
[s-pos s-pos]
|
[s-pos s-pos]
|
||||||
[snip snip]
|
[snip snip]
|
||||||
|
@ -3618,9 +3618,11 @@
|
||||||
[thisoffset (+ offset (if (direction . < . 0) need checked))]
|
[thisoffset (+ offset (if (direction . < . 0) need checked))]
|
||||||
[wl? write-locked?]
|
[wl? write-locked?]
|
||||||
[fl? flow-locked?])
|
[fl? flow-locked?])
|
||||||
|
(when (< (string-length text) (send snip get-count))
|
||||||
|
(set! text (make-string (send snip get-count))))
|
||||||
(set! write-locked? #t)
|
(set! write-locked? #t)
|
||||||
(set! flow-locked? #t)
|
(set! flow-locked? #t)
|
||||||
(let ([text (send snip get-text thisoffset thistime #f)])
|
(send snip get-text! text thisoffset thistime 0)
|
||||||
(set! write-locked? wl?)
|
(set! write-locked? wl?)
|
||||||
(set! flow-locked? fl?)
|
(set! flow-locked? fl?)
|
||||||
|
|
||||||
|
@ -3684,7 +3686,7 @@
|
||||||
(c-loop (+ i direction)
|
(c-loop (+ i direction)
|
||||||
n
|
n
|
||||||
s
|
s
|
||||||
results)))))))))
|
results))))))))
|
||||||
(if just-one?
|
(if just-one?
|
||||||
#f
|
#f
|
||||||
results)))))))))))
|
results)))))))))))
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#lang scheme/base
|
#lang racket/base
|
||||||
(require scheme/class
|
(require racket/class
|
||||||
(only-in scheme/gui/base
|
(only-in racket/gui/base
|
||||||
color%
|
color%
|
||||||
font%
|
font%
|
||||||
the-clipboard
|
the-clipboard
|
||||||
|
|
Loading…
Reference in New Issue
Block a user