Remove all cache entries between firstParagraph and lastParagraph
196933
void removeRange(int firstParagraph, int lastParagraph) {
    for(int i = 0; i < entries.size(); i++) {
      if(entries.get(i).numberOfParagraph >= firstParagraph && entries.get(i).numberOfParagraph <= lastParagraph) {
        entries.remove(i);
        i--;
      }
    }
  }
651024
void cleanupBoxedCache(int boxedAccessor) {
    for (int i = 0; i < boxedCache.length; i++)
      if (boxed[i][0] == boxedAccessor)
        boxedCache[i] = null;
  }
152853
private void pruneIfNeeded(int neededSpace) {
        if ((mTotalSize + neededSpace) < mMaxCacheSizeInBytes) {
            return;
        }
        if (VolleyLog.DEBUG) {
            VolleyLog.v("Pruning old cache entries.");
        }

        long before = mTotalSize;
        int prunedFiles = 0;
        long startTime = System.currentTimeMillis();

        Iterator<Map.Entry<String, CacheHeader>> iterator = mEntries.entrySet().iterator();
        while (iterator.hasNext()) {
            Map.Entry<String, CacheHeader> entry = iterator.next();
            CacheHeader e = entry.getValue();
            boolean deleted = getFileForKey(e.key).delete();
            if (deleted) {
                mTotalSize -= e.size;
            } else {
               VolleyLog.d("Could not delete cache entry for key=%s, filename=%s",
                       e.key, getFilenameForKey(e.key));
            }
            iterator.remove();
            prunedFiles++;

            if ((mTotalSize + neededSpace) < mMaxCacheSizeInBytes * HYSTERESIS_FACTOR) {
                break;
            }
        }

        if (VolleyLog.DEBUG) {
            VolleyLog.v("pruned %d files, %d bytes, %d ms",
                    prunedFiles, (mTotalSize - before), System.currentTimeMillis() - startTime);
        }
    }
896980
public void cleanReferenceCache() {
        final long now = currentDateSupplier.get().getTime();
        final Iterator<HardReference> it = hardReferences.iterator();
        while (it.hasNext()) {
            if (it.next().keeptSince.getTime() + REFERENCE_KEEPING_TIME <= now) {
                it.remove();
            }
        }
    }
601737
protected void prune (long now, List<Entry> history)
    {
        int prunepos = 0;
        for (int ll = history.size(); prunepos < ll; prunepos++) {
            Entry entry = history.get(prunepos);
            if (now - entry.message.timestamp < HISTORY_EXPIRATION) {
                break; // stop when we get to the first valid message
            }
        }
        history.subList(0, prunepos).clear();
    }
491085
def clear_cached_values(self):
        
        self._prof_interp = None
        self._prof_y = None
        self._prof_z = None
        self._marg_interp = None
        self._marg_z = None
        self._post = None
        self._post_interp = None
        self._interp = None
        self._ret_type = None
734780
function clearCache() {
  cache_stopById.clear();
  cache_stopByName.clear();
  cache_stopByStatusId.clear();
  cache_stops.clear();
  cache_stopsByRoute.clear();
}
588098
private synchronized void removeTail() {

        I_CmsLruCacheObject oldTail = m_listTail;
        if (oldTail != null) {
            I_CmsLruCacheObject newTail = oldTail.getNextLruObject();

            // set the list pointers correct
            if (newTail != null) {
                // there are still objects remaining in the list
                newTail.setPreviousLruObject(null);
                m_listTail = newTail;
            } else {
                // we removed the last object from the list
                m_listTail = null;
                m_listHead = null;
            }

            // update cache stats. and notify the cached object
            decreaseCache(oldTail);
        }
    }
1132467
final void clear() {
        while (!resolveCache.isEmpty()) {
            for (Iterator<Entry<String, Entries>> i = resolveCache.entrySet().iterator(); i.hasNext();) {
                Map.Entry<String, Entries> e = i.next();
                i.remove();

                e.getValue().clearAndCancel();
            }
        }
    }
420815
protected void cleanUp() {
        int prevNodeCount = ghStorage.getNodes();
        PrepareRoutingSubnetworks preparation = new PrepareRoutingSubnetworks(ghStorage, encodingManager.fetchEdgeEncoders());
        preparation.setMinNetworkSize(minNetworkSize);
        preparation.setMinOneWayNetworkSize(minOneWayNetworkSize);
        preparation.doWork();
        int currNodeCount = ghStorage.getNodes();
        logger.info("edges: " + Helper.nf(ghStorage.getAllEdges().length()) + ", nodes " + Helper.nf(currNodeCount)
                + ", there were " + Helper.nf(preparation.getMaxSubnetworks())
                + " subnetworks. removed them => " + Helper.nf(prevNodeCount - currNodeCount)
                + " less nodes");
    }
359934
@Override
	public void clearCache(CPDisplayLayout cpDisplayLayout) {
		entityCache.removeResult(CPDisplayLayoutModelImpl.ENTITY_CACHE_ENABLED,
			CPDisplayLayoutImpl.class, cpDisplayLayout.getPrimaryKey());

		finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
		finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);

		clearUniqueFindersCache((CPDisplayLayoutModelImpl)cpDisplayLayout, true);
	}
541367
public int removeAll(Predicate<K> predicate) {
    ArrayList<Entry<K, V>> oldExclusives;
    ArrayList<Entry<K, V>> oldEntries;
    synchronized (this) {
      oldExclusives = mExclusiveEntries.removeAll(predicate);
      oldEntries = mCachedEntries.removeAll(predicate);
      makeOrphans(oldEntries);
    }
    maybeClose(oldEntries);
    maybeNotifyExclusiveEntryRemoval(oldExclusives);
    maybeUpdateCacheParams();
    maybeEvictEntries();
    return oldEntries.size();
  }
1173073
public void clearExpired() {
		Iterator keys = cacheLineTable.keySet().iterator();

		while (keys.hasNext()) {
			Object key = keys.next();

			if (hasExpired(key)) {
				removeObject(key);
			}
		}
	}
979586
public static void removeAll() {
        InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.getIfSet();
        if (threadLocalMap == null) {
            return;
        }

        try {
            Object v = threadLocalMap.indexedVariable(variablesToRemoveIndex);
            if (v != null && v != InternalThreadLocalMap.UNSET) {
                @SuppressWarnings("unchecked")
                Set<FastThreadLocal<?>> variablesToRemove = (Set<FastThreadLocal<?>>) v;
                FastThreadLocal<?>[] variablesToRemoveArray =
                        variablesToRemove.toArray(new FastThreadLocal[0]);
                for (FastThreadLocal<?> tlv: variablesToRemoveArray) {
                    tlv.remove(threadLocalMap);
                }
            }
        } finally {
            InternalThreadLocalMap.remove();
        }
    }
959203
@Override
	protected int pruneCache() {
		int count = 0;
		Iterator<CacheObj<K, V>> values = cacheMap.values().iterator();
		CacheObj<K, V> co;
		while (values.hasNext()) {
			co = values.next();
			if (co.isExpired()) {
				values.remove();
				onRemove(co.key, co.obj);
				count++;
			}
		}
		return count;
	}
435800
public function cleanUpGarbage()
    {
        $cacheFilesExpire = time() - $this->getCacheLifetime() * 3600 * 24;

        // relies on templates sorting order being related to their modification dates
        $upperLimit = $this->getPhpCodeDestination() . $this->getFunctionNamePrefix($cacheFilesExpire) . '_';
        $lowerLimit = $this->getPhpCodeDestination() . $this->getFunctionNamePrefix(0);

        // second * gets phptal:cache
        $cacheFiles = glob($this->getPhpCodeDestination() . 'tpl_????????_*.' . $this->getPhpCodeExtension() . '*');

        if ($cacheFiles) {
            foreach ($cacheFiles as $index => $file) {

                // comparison here skips filenames that are certainly too new
                if (strcmp($file, $upperLimit) <= 0 || substr($file, 0, strlen($lowerLimit)) === $lowerLimit) {
                    $time = filemtime($file);
                    if ($time && $time < $cacheFilesExpire) {
                        @unlink($file);
                    }
                }
            }
        }
    }
1129170
def _cleanup(self):  # pragma: no cover
        
        need_to_delete = []  # can't delete from a dict while iterating
        with self.attr_lock:
            now_time = time()
            for path in self.cache:
                if now_time - self.attr[path][TIMESTAMP_KEY] >= MAX_CACHE_TIME:
                    need_to_delete.append(path)
            for path in need_to_delete:
                del self.attr[path]
                del self.cache[path]