Cursor.st
changeset 4508 00cc9b6d2f1f
parent 4403 3342601d3fed
child 4518 b6eec5a4632b
--- a/Cursor.st	Mon Mar 06 09:52:50 2006 +0100
+++ b/Cursor.st	Mon Mar 06 09:53:47 2006 +0100
@@ -2320,17 +2320,16 @@
     "return one of the standard cursors already associated to aDevice.
      This is the same as '(Cursor shape:aShape) on:aDevice' but somwehat faster."
 
+    |oldCursor|
+
     aDevice isNil ifTrue:[
         ^ self basicNew setShape:aShape
     ].
 
     "first look if not already known"
 
-    aDevice deviceCursors do:[:aCursor |
-        aCursor shape == aShape ifTrue:[
-            ^ aCursor
-        ]
-    ].
+    oldCursor := aDevice deviceCursors detect:[:aCursor | aCursor shape == aShape] ifNone:nil.
+    oldCursor notNil ifTrue:[ ^ oldCursor ].
 
     ^ (self basicNew setShape:aShape) allocateOnDevice:aDevice
 !
@@ -3342,7 +3341,7 @@
 !Cursor class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Cursor.st,v 1.103 2005-07-12 13:58:44 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Cursor.st,v 1.104 2006-03-06 08:53:47 cg Exp $'
 ! !
 
 Cursor initialize!