Skip to content

Commit

Permalink
Minor: remove string copy from Column::from_qualified_name
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Jun 17, 2024
1 parent 378b9ee commit 5d3ec72
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions datafusion/common/src/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
}

Expand Down

0 comments on commit 5d3ec72

Please sign in to comment.