You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Note:**`setWithEvicted()` always calls `set()`with `bypass = true`, which means TTL is never reset during `setWithEvicted()` operations, regardless of the `resetTtl` parameter.
204
+
**Note:**Unlike `set()`, `setWithEvicted()`does not use a `bypass` parameter, so TTL is reset when `resetTtl = true`.
200
205
201
206
**Time Complexity:** $O(1)$ amortized
202
207
@@ -232,7 +237,7 @@ first \leftarrow null \land last \leftarrow null & \text{if } item.prev = null \
232
237
$$\begin{align}
233
238
moveToEnd(item) &= \begin{cases}
234
239
\text{no-op} & \text{if } item = last \\
235
-
item.prev.next \leftarrow item.next \land item.next.prev \leftarrow item.prev \land first \leftarrow item.next \land item.prev \leftarrow last \land last.next \leftarrow item \land last \leftarrow item \land first \leftarrow item \lor first & \text{if } item \neq last
240
+
item.prev.next \leftarrow item.next \land item.next.prev \leftarrow item.prev \land first \leftarrow item.next \land item.prev \leftarrow last \land last.next \leftarrow item \land last \leftarrow item & \text{if } item \neq last
6.**TTL Reset Invariant:** TTL is only reset during `set()` operations when `bypass = false`, and during `setWithEvicted()`operations when `resetTtl = true`
0 commit comments