aboutsummaryrefslogtreecommitdiffstats
path: root/lib/utils.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-05-05 16:43:48 +0100
committerStephen Blott2015-05-05 16:43:48 +0100
commit28807bd25b27e5404228a638f2ab5e6c00f606cc (patch)
treece0d1f8aef6911cc250a7e1b57d4b553333eeb90 /lib/utils.coffee
parent43bdd2787f2bffc4fc9c3397937a0ce9a183beda (diff)
downloadvimium-28807bd25b27e5404228a638f2ab5e6c00f606cc.tar.bz2
Search completion; misc.
Diffstat (limited to 'lib/utils.coffee')
-rw-r--r--lib/utils.coffee6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/utils.coffee b/lib/utils.coffee
index 1b2a7a3f..e97872f0 100644
--- a/lib/utils.coffee
+++ b/lib/utils.coffee
@@ -207,14 +207,14 @@ globalRoot.extend = (hash1, hash2) ->
hash1[key] = hash2[key]
hash1
-# A simple cache. Entries used within an expiry period are retained (for one more expiry period), otherwise
-# they are discarded.
+# A simple cache. Entries used within two expiry periods are retained, otherwise they are discarded.
+# At most 2 * @entries entries are retained.
class SimpleCache
# expiry: expiry time in milliseconds (default, one hour)
# entries: maximum number of entries in @cache (there may be this many entries in @previous, too)
constructor: (@expiry = 60 * 60 * 1000, @entries = 1000) ->
@cache = {}
- @rotate() # Force starts the rotation timer.
+ @rotate() # Force start the rotation timer.
rotate: ->
@previous = @cache