Skip to content

Commit 325cb8d

Browse files
committed
remove redundant stmtCacheSize check in putCachedStmt
When stmtCacheSize <= 0, stmtCacheCount >= stmtCacheSize is always true, so the explicit check is unnecessary.
1 parent 061c2a5 commit 325cb8d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sqlite3.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,7 @@ func (c *SQLiteConn) putCachedStmt(s *SQLiteStmt) bool {
19411941
c.mu.Lock()
19421942
defer c.mu.Unlock()
19431943

1944-
if c.db == nil || c.stmtCacheSize <= 0 || c.stmtCacheCount >= c.stmtCacheSize {
1944+
if c.db == nil || c.stmtCacheCount >= c.stmtCacheSize {
19451945
return false
19461946
}
19471947
c.stmtCache[s.cacheKey] = append(c.stmtCache[s.cacheKey], s)

0 commit comments

Comments
 (0)