Skip to content

Commit b6cdeb5

Browse files
committed
refactor: avoid String allocation in extended query handler
Use reference instead of calling .to_string() on query string as suggested by mjgarton - the query is only used for logging and doesn't need to be owned.
1 parent 49c9132 commit b6cdeb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

datafusion-postgres/src/handlers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ impl ExtendedQueryHandler for DfSessionService {
263263
where
264264
C: ClientInfo + Unpin + Send + Sync,
265265
{
266-
let query = portal.statement.statement.0.to_string();
266+
let query = &portal.statement.statement.0;
267267
log::debug!("Received execute extended query: {query}"); // Log for debugging
268268

269269
// Check query hooks first

0 commit comments

Comments
 (0)