[Pharo-project] Issue 3344 in pharo: No brainer fix for hasBindingThatBeginWith:

pharo at googlecode.com pharo at googlecode.com
Sat Nov 27 18:06:03 CET 2010


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!






More information about the Pharo-project mailing list