Issue 3344 in pharo: No brainer fix for hasBindingThatBeginWith:

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

Issue 3344 in pharo: No brainer fix for hasBindingThatBeginWith:

pharo
Status: Fixed
Owner: stephane.ducasse
Labels: Milestone-1.2

New issue 3344 by stephane.ducasse: No brainer fix for  
hasBindingThatBeginWith:
http://code.google.com/p/pharo/issues/detail?id=3344

SystemDictionary>>hasBindingThatBeginsWith: aString
        "Use the cached class and non-class names for better performance."

        | name searchBlock |
        searchBlock := [ :element |
                (element beginsWith: aString)
                        ifTrue: [ 0 ]
                        ifFalse: [
                                aString < element
                                        ifTrue: [ -1 ]
                                        ifFalse: [ 1 ] ] ].
        name := self classNames
                findBinary: searchBlock
+               ifNone: [ nil ].
-               ifNone: nil.
        name ifNotNil: [ ^true ].
        name := self nonClassNames
                findBinary: searchBlock
+               ifNone: [ nil ].
-               ifNone: nil.
        ^name notNil!



Reply | Threaded
Open this post in threaded view
|

Re: Issue 3344 in pharo: No brainer fix for hasBindingThatBeginWith:

pharo
Updates:
        Status: Closed

Comment #1 on issue 3344 by marcus.denker: No brainer fix for  
hasBindingThatBeginWith:
http://code.google.com/p/pharo/issues/detail?id=3344

12264