CachingRegistry.st
branchjv
changeset 20398 8cb53f870d39
parent 20079 8d884971c2ed
parent 20388 db4b243d97ce
child 20577 a27e7b3031cb
--- a/CachingRegistry.st	Mon Sep 19 08:39:59 2016 +0100
+++ b/CachingRegistry.st	Mon Sep 19 08:46:27 2016 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1999 by eXept Software AG
 	      All Rights Reserved
@@ -63,6 +65,22 @@
 "
 ! !
 
+!CachingRegistry methodsFor:'enumerating'!
+
+detect:aBlock ifNone:exceptionValue
+    "... additionaly move it to the front of the LRU chain"
+
+    keyArray validElementsDo:[:obj |
+        (obj ~~ DeletedEntry and:[aBlock value:obj]) ifTrue:[
+            keptReferences 
+                removeIdentical:obj ifAbsent:[];
+                addLast:obj.
+            ^ obj
+        ].
+    ].
+    ^ exceptionValue value
+! !
+
 !CachingRegistry methodsFor:'private'!
 
 cacheSize:aNumber