mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-27 18:56:30 +00:00
remove unnecessary allocation
This commit is contained in:
@@ -34,11 +34,10 @@ impl<'a> Plugin for TableAccess<'a> {
|
|||||||
|
|
||||||
visit_relations(ast, |relation| {
|
visit_relations(ast, |relation| {
|
||||||
let relation = relation.to_string();
|
let relation = relation.to_string();
|
||||||
let parts = relation.split('.').collect::<Vec<&str>>();
|
let table_name = relation.split('.').last().unwrap().to_string();
|
||||||
let table_name = parts.last().unwrap();
|
|
||||||
|
|
||||||
if self.tables.contains(&table_name.to_string()) {
|
if self.tables.contains(&table_name) {
|
||||||
found = Some(table_name.to_string());
|
found = Some(table_name);
|
||||||
ControlFlow::<()>::Break(())
|
ControlFlow::<()>::Break(())
|
||||||
} else {
|
} else {
|
||||||
ControlFlow::<()>::Continue(())
|
ControlFlow::<()>::Continue(())
|
||||||
|
|||||||
Reference in New Issue
Block a user