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:
Yasuhiro Matsumoto
2026-04-08 13:39:22 +09:00
parent 061c2a5f43
commit 325cb8d5d9

View File

@@ -1941,7 +1941,7 @@ func (c *SQLiteConn) putCachedStmt(s *SQLiteStmt) bool {
c.mu.Lock()
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
}
c.stmtCache[s.cacheKey] = append(c.stmtCache[s.cacheKey], s)