Issue 260 in glassdb: Sorting of SortedCollection superfluous

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

Issue 260 in glassdb: Sorting of SortedCollection superfluous

glassdb
Status: Accepted
Owner: [hidden email]
Labels: Type-Defect Priority-Medium GLASS-Server Version-2.4.x  
Version-1.0-beta.8

New issue 260 by [hidden email]: Sorting of SortedCollection  
superfluous
http://code.google.com/p/glassdb/issues/detail?id=260

What steps will reproduce the problem?
1. #( a b c d ) asSortedCollection sort: [:a :b| a <= b]
results in an error

Solution:

implement SortedCollection>>#sort: not to use the super
implementation but to just update the sort block:

"in *squeak-sorting"
sort: aBlock
        " we don't need the merge sort from super, just update our sort block,
        also acusing a resort."

        self sortBlock: aBlock



Reply | Threaded
Open this post in threaded view
|

Re: Issue 260 in glassdb: Sorting of SortedCollection superfluous

glassdb
Updates:
        Labels: Milestone-1.0-beta.8.7

Comment #1 on issue 260 by [hidden email]: Sorting of SortedCollection  
superfluous
http://code.google.com/p/glassdb/issues/detail?id=260

(No comment was entered for this change.)

Reply | Threaded
Open this post in threaded view
|

Re: Issue 260 in glassdb: Sorting of SortedCollection superfluous

glassdb
Updates:
        Status: Fixed
        Labels: Fixed-1.0-beta.8.7

Comment #2 on issue 260 by [hidden email]: Sorting of  
SortedCollection superfluous
http://code.google.com/p/glassdb/issues/detail?id=260

I am a little wary about changing the sortBlock of a SortedCollection as a  
side effect of #sort:.

A slightly better solution is to implement #sort: as:

   sort: aBlock

     ^self asArray sort: aBlock

GsCore 0.245 (dkh.213)