colus 02/03/29 23:11:14
Modified: cache/src/java/org/apache/avalon/excalibur/cache
AbstractCache.java
Log:
Move CacheEvent creation to outter of loop.
Revision Changes Path
1.10 +8 -8
jakarta-avalon-excalibur/cache/src/java/org/apache/avalon/excalibur/cache/AbstractCache.java
Index: AbstractCache.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/cache/src/java/org/apache/avalon/excalibur/cache/AbstractCache.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- AbstractCache.java 27 Mar 2002 14:35:10 -0000 1.9
+++ AbstractCache.java 30 Mar 2002 07:11:14 -0000 1.10
@@ -40,12 +40,12 @@
CacheEvent event = null;
final int s = m_listeners.size();
+ if( 0 < s )
+ {
+ event = new CacheEvent( this, key, value );
+ }
for( int i = 0; i < s; i++ )
{
- if( event == null )
- {
- event = new CacheEvent( this, key, value );
- }
( (CacheListener)m_listeners.get( i ) ).added( event );
}
}
@@ -55,12 +55,12 @@
CacheEvent event = null;
final int s = m_listeners.size();
+ if( 0 < s )
+ {
+ event = new CacheEvent( this, key, value );
+ }
for( int i = 0; i < s; i++ )
{
- if( event == null )
- {
- event = new CacheEvent( this, key, value );
- }
( (CacheListener)m_listeners.get( i ) ).removed( event );
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>