From bc36de7dec7237efeb1dfdb838bf58c47b9d1dbb Mon Sep 17 00:00:00 2001 From: Patrick Mylund Nielsen Date: Mon, 22 Dec 2014 02:15:12 -0500 Subject: [PATCH] Clarify NewFrom documentation on use cases --- cache.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cache.go b/cache.go index 595529d..2d53187 100644 --- a/cache.go +++ b/cache.go @@ -1003,10 +1003,10 @@ func New(defaultExpiration, cleanupInterval time.Duration) *Cache { // deleted from the cache before calling c.DeleteExpired(). // // NewFrom also accepts an items map which will serve as the underlying map -// for the cache. This is useful for deserializing a cache (serialized using -// e.g. gob.Encode on c.Items()), or setting a starting size by passing in e.g. -// make(map[string]*Item, 500) to avoid repeat initial resizing of a map that's -// expected to reach a certain minimum size. +// for the cache. This is useful for starting from a deserialized cache +// (serialized using e.g. gob.Encode() on c.Items()), or passing in e.g. +// make(map[string]*Item, 500) to improve startup performance when the cache +// is expected to reach a certain minimum size. // // Only the cache's methods synchronize access to this map, so it is not // recommended to keep any references to the map around after creating a cache.