This is an automated email from the ASF dual-hosted git repository.
comphead pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new e1cfb48215 Minor: remove string copy from Column::from_qualified_name
(#10947)
e1cfb48215 is described below
commit e1cfb48215ee91a183e06cfee602e42d2c23f429
Author: Andrew Lamb <[email protected]>
AuthorDate: Mon Jun 17 13:18:04 2024 -0400
Minor: remove string copy from Column::from_qualified_name (#10947)
---
datafusion/common/src/column.rs | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/datafusion/common/src/column.rs b/datafusion/common/src/column.rs
index 911ff079de..3e2bc0ad7c 100644
--- a/datafusion/common/src/column.rs
+++ b/datafusion/common/src/column.rs
@@ -109,21 +109,21 @@ impl Column {
/// `foo.BAR` would be parsed to a reference to relation `foo`, column
name `bar` (lower case)
/// where `"foo.BAR"` would be parsed to a reference to column named
`foo.BAR`
pub fn from_qualified_name(flat_name: impl Into<String>) -> Self {
- let flat_name: &str = &flat_name.into();
- Self::from_idents(&mut parse_identifiers_normalized(flat_name, false))
+ let flat_name = flat_name.into();
+ Self::from_idents(&mut parse_identifiers_normalized(&flat_name, false))
.unwrap_or_else(|| Self {
relation: None,
- name: flat_name.to_owned(),
+ name: flat_name,
})
}
/// Deserialize a fully qualified name string into a column preserving
column text case
pub fn from_qualified_name_ignore_case(flat_name: impl Into<String>) ->
Self {
- let flat_name: &str = &flat_name.into();
- Self::from_idents(&mut parse_identifiers_normalized(flat_name, true))
+ let flat_name = flat_name.into();
+ Self::from_idents(&mut parse_identifiers_normalized(&flat_name, true))
.unwrap_or_else(|| Self {
relation: None,
- name: flat_name.to_owned(),
+ name: flat_name,
})
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]