remove redundant stmtCacheSize check in putCachedStmt
When stmtCacheSize <= 0, stmtCacheCount >= stmtCacheSize is always true, so the explicit check is unnecessary.
This commit is contained in:
@@ -1941,7 +1941,7 @@ func (c *SQLiteConn) putCachedStmt(s *SQLiteStmt) bool {
|
|||||||
c.mu.Lock()
|
c.mu.Lock()
|
||||||
defer c.mu.Unlock()
|
defer c.mu.Unlock()
|
||||||
|
|
||||||
if c.db == nil || c.stmtCacheSize <= 0 || c.stmtCacheCount >= c.stmtCacheSize {
|
if c.db == nil || c.stmtCacheCount >= c.stmtCacheSize {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
c.stmtCache[s.cacheKey] = append(c.stmtCache[s.cacheKey], s)
|
c.stmtCache[s.cacheKey] = append(c.stmtCache[s.cacheKey], s)
|
||||||
|
|||||||
Reference in New Issue
Block a user