Re: Issue 2178 in pharo: Reverse the logic and avoid a copy in DeflateStream

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

Re: Issue 2178 in pharo: Reverse the logic and avoid a copy in DeflateStream

pharo

Comment #2 on issue 2178 by [hidden email]: Reverse the logic and  
avoid a copy in DeflateStream
http://code.google.com/p/pharo/issues/detail?id=2178

Hmm, the code in squeak sounds false if species differ:
it should only iterate from startIndex to: startIndex + bytesCount - 1 do:  
[:i | ]...


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 2178 in pharo: Reverse the logic and avoid a copy in DeflateStream

pharo

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=2178

Name: 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
Reply | Threaded
Open this post in threaded view
|

Re: Issue 2178 in pharo: Reverse the logic and avoid a copy in DeflateStream

pharo

Comment #4 on issue 2178 by [hidden email]: Reverse the logic and  
avoid a copy in DeflateStream
http://code.google.com/p/pharo/issues/detail?id=2178

tx.

Stef


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 2178 in pharo: Reverse the logic and avoid a copy in DeflateStream

pharo
Updates:
        Status: WorkNeeded

Comment #5 on issue 2178 by [hidden email]: Reverse the logic and  
avoid a copy in DeflateStream
http://code.google.com/p/pharo/issues/detail?id=2178

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 2178 in pharo: Reverse the logic and avoid a copy in DeflateStream

pharo
Updates:
        Labels: Difficulty-Easy

Comment #6 on issue 2178 by [hidden email]: Reverse the logic and  
avoid a copy in DeflateStream
http://code.google.com/p/pharo/issues/detail?id=2178

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker