From ff9bc9cf75f497611419666c47b8021ed10f9999 Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Wed, 13 May 2026 11:01:20 +0900 Subject: [PATCH] Drop redundant .to_s inside string interpolation In `CallableStatement#bind_param_index` the leading-colon normalization wrote `":#{key.to_s}"`. String interpolation already invokes `to_s` on the embedded expression, so the explicit call is redundant. The `key.to_s =~ /^:/` on the right-hand side is intentionally kept; that one is outside the interpolation and ensures the regex match receives a String regardless of whether `key` is a Symbol or String. No behavior change. Full suite is green (468 examples, 0 failures, 1 pre-existing pending). Co-Authored-By: Claude Opus 4.7 (1M context) --- lib/plsql/jdbc_connection.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plsql/jdbc_connection.rb b/lib/plsql/jdbc_connection.rb index 66a9ad5..9fb3837 100644 --- a/lib/plsql/jdbc_connection.rb +++ b/lib/plsql/jdbc_connection.rb @@ -189,7 +189,7 @@ def close def bind_param_index(key) return key if key.kind_of? Integer - key = ":#{key.to_s}" unless key.to_s =~ /^:/ + key = ":#{key}" unless key.to_s =~ /^:/ @params.index(key) + 1 end end