Correct condition for when time is needed

This commit is contained in:
Jason Tedor 2015-10-02 11:55:36 +02:00
parent 01e7378804
commit 105d830114
1 changed files with 1 additions and 1 deletions

View File

@ -117,7 +117,7 @@ public class Cache<K, V> {
*/
protected long now() {
// System.nanoTime takes non-negligible time, so we only use it if we need it
return expireAfterAccess == -1 ? 0 : System.nanoTime();
return expireAfterWrite != -1 || expireAfterAccess != -1 ? System.nanoTime() : 0;
}
public void setExpireAfterWrite(long expireAfterWrite) {