瀏覽代碼

WalledCheckCache: rename field and parameter for clarity

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
Álvaro Brey 2 年之前
父節點
當前提交
f3a810600d
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      app/src/main/java/com/nextcloud/client/network/WalledCheckCache.kt

+ 6 - 6
app/src/main/java/com/nextcloud/client/network/WalledCheckCache.kt

@@ -29,11 +29,11 @@ import javax.inject.Singleton
 @Singleton
 class WalledCheckCache @Inject constructor(private val clock: Clock) {
 
-    private var value: Pair<Long, Boolean>? = null
+    private var cachedEntry: Pair<Long, Boolean>? = null
 
     @Synchronized
     fun isExpired(): Boolean {
-        return when (val timestamp = value?.first) {
+        return when (val timestamp = cachedEntry?.first) {
             null -> true
             else -> {
                 val diff = clock.millisSinceBoot - timestamp
@@ -43,21 +43,21 @@ class WalledCheckCache @Inject constructor(private val clock: Clock) {
     }
 
     @Synchronized
-    fun setValue(value: Boolean) {
-        this.value = Pair(clock.millisSinceBoot, value)
+    fun setValue(isWalled: Boolean) {
+        this.cachedEntry = Pair(clock.millisSinceBoot, isWalled)
     }
 
     @Synchronized
     fun getValue(): Boolean? {
         return when (isExpired()) {
             true -> null
-            else -> value?.second
+            else -> cachedEntry?.second
         }
     }
 
     @Synchronized
     fun clear() {
-        value = null
+        cachedEntry = null
     }
 
     companion object {