From 325cb8d5d939baa141c92a6a3bf5289cfef3b8b2 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Wed, 8 Apr 2026 13:39:22 +0900 Subject: [PATCH] remove redundant stmtCacheSize check in putCachedStmt When stmtCacheSize <= 0, stmtCacheCount >= stmtCacheSize is always true, so the explicit check is unnecessary. --- sqlite3.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlite3.go b/sqlite3.go index 5861a2f..a05cfd4 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -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)