Skip to content

Commit

Permalink
Changed to reference equals for plan removal.
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveDeCaprio committed Mar 14, 2019
1 parent 1d693af commit 1bb2511
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class CacheManager extends Logging {
}
val plansToUncache = cachedData.filter(cd => shouldRemove(cd.plan))
this.synchronized {
cachedData = cachedData.filter(!plansToUncache.contains(_))
cachedData = cachedData.filterNot(cd => plansToUncache.exists(_ eq cd))
}
plansToUncache.foreach { _.cachedRepresentation.cacheBuilder.clearCache(blocking) }

Expand Down Expand Up @@ -170,7 +170,7 @@ class CacheManager extends Logging {
val needToRecache = cachedData.filter(condition)
this.synchronized {
// Remove the cache entry before creating a new ones.
cachedData = cachedData.filter(!needToRecache.contains(_))
cachedData = cachedData.filterNot(cd => needToRecache.exists(_ eq cd))
}
needToRecache.map { cd =>
cd.cachedRepresentation.cacheBuilder.clearCache()
Expand Down

0 comments on commit 1bb2511

Please sign in to comment.