#TUNING by stefan
authorStefan Vogel <sv@exept.de>
Wed, 08 May 2019 15:04:19 +0200
changeset 24120 1857df80bf3c
parent 24119 458b88178b7c
child 24121 d0148c842873
#TUNING by stefan class: CharacterArray changed: #isNameSpaceSelector
CharacterArray.st
--- a/CharacterArray.st	Wed May 08 13:12:23 2019 +0200
+++ b/CharacterArray.st	Wed May 08 15:04:19 2019 +0200
@@ -6963,17 +6963,8 @@
      is legal, and this can be checked quickly by just looking at the first character.
      You cannot easily change this algorithm here, as it is also known by the VM's lookup function."
 
-    |i|
-
     (self at:1) == $: ifFalse:[^ false].
-
-    i := self indexOf:$: startingAt:2.
-    i == 0 ifTrue:[^ false].
-    self size <= (i+1) ifTrue:[^ false].
-    (self at:i+1) == $: ifFalse:[^ false].
-    (self at:i+2) == $: ifTrue:[^ false].
-    "/ could check if the rest after the ns-prefix and colons is a valid selector...
-    ^ true
+    ^ (self indexOfSubCollection:'::' startingAt:3 ifAbsent:0 caseSensitive:true) ~~ 0.
 
     "test:
      self assert:('+' isNameSpaceSelector) not.
@@ -6985,6 +6976,7 @@
     "
 
     "Created: / 05-03-2007 / 11:35:31 / cg"
+    "Modified: / 08-05-2019 / 14:41:30 / Stefan Vogel"
 !
 
 isNumeric