aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/par/work.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/go/internal/par/work.go')
-rw-r--r--src/cmd/go/internal/par/work.go41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/cmd/go/internal/par/work.go b/src/cmd/go/internal/par/work.go
index 5b6de9425a..881b51be19 100644
--- a/src/cmd/go/internal/par/work.go
+++ b/src/cmd/go/internal/par/work.go
@@ -180,44 +180,3 @@ func (c *Cache[K, V]) Get(key K) (V, bool) {
}
return e.result, true
}
-
-// Clear removes all entries in the cache.
-//
-// Concurrent calls to Get may return old values. Concurrent calls to Do
-// may return old values or store results in entries that have been deleted.
-//
-// TODO(jayconrod): Delete this after the package cache clearing functions
-// in internal/load have been removed.
-func (c *Cache[K, V]) Clear() {
- c.m.Range(func(key, value any) bool {
- c.m.Delete(key)
- return true
- })
-}
-
-// Delete removes an entry from the map. It is safe to call Delete for an
-// entry that does not exist. Delete will return quickly, even if the result
-// for a key is still being computed; the computation will finish, but the
-// result won't be accessible through the cache.
-//
-// TODO(jayconrod): Delete this after the package cache clearing functions
-// in internal/load have been removed.
-func (c *Cache[K, V]) Delete(key K) {
- c.m.Delete(key)
-}
-
-// DeleteIf calls pred for each key in the map. If pred returns true for a key,
-// DeleteIf removes the corresponding entry. If the result for a key is
-// still being computed, DeleteIf will remove the entry without waiting for
-// the computation to finish. The result won't be accessible through the cache.
-//
-// TODO(jayconrod): Delete this after the package cache clearing functions
-// in internal/load have been removed.
-func (c *Cache[K, V]) DeleteIf(pred func(key K) bool) {
- c.m.Range(func(key, _ any) bool {
- if key := key.(K); pred(key) {
- c.Delete(key)
- }
- return true
- })
-}