소스 검색

refine code style

kevin 5 년 전
부모
커밋
f87d9d1dda
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      core/stores/cache/cachenode.go

+ 4 - 4
core/stores/cache/cachenode.go

@@ -175,12 +175,12 @@ func (c cacheNode) doTake(v interface{}, key string, query func(v interface{}) e
 	}
 	if fresh {
 		return nil
-	} else {
-		// got the result from previous ongoing query
-		c.stat.IncrementTotal()
-		c.stat.IncrementHit()
 	}
 
+	// got the result from previous ongoing query
+	c.stat.IncrementTotal()
+	c.stat.IncrementHit()
+
 	return jsonx.Unmarshal(val.([]byte), v)
 }