Comment #3 on issue 2178 by
[hidden email]: Reverse the logic and
avoid a copy in DeflateStream
http://code.google.com/p/pharo/issues/detail?id=2178Name: Compression-nice.30
Author: nice
Time: 10 September 2011, 2:00:10.516 pm
UUID: 9a13d6e4-7dd0-48e3-a097-456788f53488
Ancestors: Compression-ul.29
Bugfix: startIndex would be ignored and an incorrect bytesCount could be
copied when collection species differ in
DeflateStream>>next:putAll:startingAt:
=============== Diff against Compression-ul.29 ===============
Item was changed:
----- Method: DeflateStream>>next:putAll:startingAt: (in
category 'accessing') -----
next: bytesCount putAll: aCollection startingAt: startIndex
| start count max |
aCollection species = collection species
+ ifFalse:
+ [startIndex to: startIndex + bytesCount - 1 do: [:i
| self nextPut: (aCollection at: i)].
- ifFalse:[
- aCollection do:[:ch| self nextPut: ch].
^aCollection].
start := startIndex.
count := bytesCount.
[count = 0] whileFalse:[
position = writeLimit ifTrue:[self deflateBlock].
max := writeLimit - position.
max > count ifTrue:[max := count].
collection replaceFrom: position+1
to: position+max
with: aCollection
startingAt: start.
start := start + max.
count := count - max.
position := position + max].
^aCollection!
_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker