The Trunk: Compression-ul.49.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Compression-ul.49.mcz

commits-2
Levente Uzonyi uploaded a new version of Compression to project The Trunk:
http://source.squeak.org/trunk/Compression-ul.49.mcz

==================== Summary ====================

Name: Compression-ul.49
Author: ul
Time: 24 August 2016, 9:23:23.899054 pm
UUID: a194073a-524e-4842-981e-cb4a433229e6
Ancestors: Compression-cmm.48

Don't let #next:putAll:startingAt: roll back the receiver when the first argument is negative.

=============== Diff against Compression-cmm.48 ===============

Item was changed:
  ----- Method: DeflateStream>>next:putAll:startingAt: (in category 'accessing') -----
  next: bytesCount putAll: aCollection startingAt: startIndex
+
  | start count max |
+ bytesCount > 0 ifFalse: [ ^aCollection ].
  aCollection species = collection species
  ifFalse:
  [startIndex to: startIndex + bytesCount - 1 do: [:i | self nextPut: (aCollection at: i)].
  ^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!