avoid copying bytes when not necessary
This commit is contained in:
parent
5e70534b43
commit
23f9677e52
|
@ -3003,7 +3003,12 @@
|
||||||
(cond
|
(cond
|
||||||
[(= start end) (flush-proc)]
|
[(= start end) (flush-proc)]
|
||||||
[else
|
[else
|
||||||
(define pair (cons (subbytes to-write start end) style))
|
(define pair (cons (if (and (= start 0)
|
||||||
|
(= end (bytes-length to-write))
|
||||||
|
(immutable? to-write))
|
||||||
|
to-write
|
||||||
|
(subbytes to-write start end))
|
||||||
|
style))
|
||||||
(cond
|
(cond
|
||||||
[(eq? (current-thread) (eventspace-handler-thread eventspace))
|
[(eq? (current-thread) (eventspace-handler-thread eventspace))
|
||||||
(define return-channel (make-channel))
|
(define return-channel (make-channel))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user