public boolean remove ( Entry < K , V > e ) { int _hash = modifiedHashCode ( e . hashCode ) ; OptimisticLock [ ] _locks = locks ; int si = _hash & LOCK_MASK ; OptimisticLock l = _locks [ si ] ; long _stamp = l . writeLock ( ) ; try { Entry < K , V > f ; Entry < K , V > [ ] tab = entries ; if ( tab == null ) { throw new CacheClosedException ( cache ) ; } int n = tab . length , _mask = n - 1 , idx = _hash & ( _mask ) ; f = tab [ idx ] ; if ( f == e ) { tab [ idx ] = f . another ; segmentSize [ si ] . decrementAndGet ( ) ; return true ; } while ( f != null ) { Entry < K , V > _another = f . another ; if ( _another == e ) { f . another = _another . another ; segmentSize [ si ] . decrementAndGet ( ) ; return true ; } f = _another ; } } finally { l . unlockWrite ( _stamp ) ; } return false ; }
Remove existing entry from the hash .