Issue 7214 in pharo: versionList in MC can be optimized by not using a sortedCollection

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

Issue 7214 in pharo: versionList in MC can be optimized by not using a sortedCollection

pharo
Status: Accepted
Owner: [hidden email]
Labels: Type-Bug

New issue 7214 by [hidden email]: versionList in MC can be optimized  
by not using a sortedCollection
http://code.google.com/p/pharo/issues/detail?id=7214

In squeak levente


versionList
        | result sortBlock |
        result := selectedPackage isNil
                ifTrue: [ versions ]
                ifFalse: [ versions select: [ :each | selectedPackage = each first ] ].
        sortBlock := (self orderSpecs at: order) value.
        sortBlock isNil ifFalse: [
                result := result asSortedCollection: [:a :b | [sortBlock value: a value:  
b] on: Error do: [true]]].
        ^result := result
                collect: [ :each | self versionHighlight: each fourth ]

transformed it in


MCFileRepositoryInspector>>versionList

        | result |
        result := selectedPackage
                ifNil: [ versions copy ]
                ifNotNil: [ versions select: [ :each | selectedPackage = each first ] ].
        (self orderSpecs at: order) value ifNotNil: [ :sortBlock |
                result sort: [:a :b | [ sortBlock value: a value: b ] on: Error do: [  
true ] ] ].
        ^result replace: [ :each | self versionHighlight: each fourth ]

So it would be nice to measure the gain and if this is good to introduce it  
in Pharo



_______________________________________________
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 7214 in pharo: versionList in MC can be optimized by not using a sortedCollection

pharo
Updates:
        Labels: -Type-Bug Type-Enh Target-Monticello Milestone-3.0

Comment #1 on issue 7214 by [hidden email]: versionList in MC can be  
optimized by not using a sortedCollection
http://code.google.com/p/pharo/issues/detail?id=7214

(No comment was entered for this change.)


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