From 49286244e93065250d9ed8dfd4bf35705b691885 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Thu, 22 Jan 2026 18:21:34 -0700 Subject: [PATCH] perf: remove unnecessary string clone in maybe_concat_string_literal Replace `s.clone().as_str()` with just `s` since `s` is already a `&String` which can be passed directly to `push_str()`. This removes one String allocation per concatenated string literal when parsing SQL with adjacent string literals like 'foo' 'bar'. Co-Authored-By: Claude Opus 4.5 --- src/parser/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 882803a5a..85e30ff68 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -11299,7 +11299,7 @@ impl<'a> Parser<'a> { while let Token::SingleQuotedString(ref s) | Token::DoubleQuotedString(ref s) = self.peek_token_ref().token { - str.push_str(s.clone().as_str()); + str.push_str(s); self.advance_token(); } }