mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-29 11:20:38 +00:00
perf: change current schema and catalog to borrow, clone only necessary (#2116)
perf: change current schema and catalog to borrow, clone only when necessary Co-authored-by: gongzhengyang <gongzhengyang@bolean.com.cn>
This commit is contained in:
@@ -79,13 +79,13 @@ impl QueryContext {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn current_schema(&self) -> String {
|
||||
self.current_schema.clone()
|
||||
pub fn current_schema(&self) -> &str {
|
||||
&self.current_schema
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn current_catalog(&self) -> String {
|
||||
self.current_catalog.clone()
|
||||
pub fn current_catalog(&self) -> &str {
|
||||
&self.current_catalog
|
||||
}
|
||||
|
||||
#[inline]
|
||||
@@ -96,7 +96,7 @@ impl QueryContext {
|
||||
pub fn get_db_string(&self) -> String {
|
||||
let catalog = self.current_catalog();
|
||||
let schema = self.current_schema();
|
||||
build_db_string(&catalog, &schema)
|
||||
build_db_string(catalog, schema)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
||||
Reference in New Issue
Block a user