From 146a92612b6dca6b777e5ea8093b4585002df8ef Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 21 Feb 2022 12:07:26 -0500 Subject: [PATCH] rgw/dbstore: DBOpPrepareInfo::query_str is a view in `SQLiteDB::InitPrepareParams()`, `DBOpInfo::query_str` is assigned to `DBOpPrepareInfo::query_str`: p_params.op.query_str = params->op.query_str; by making `DBOpPrepareInfo::query_str` a view, we avoid allocating a copy of the `std::string` Signed-off-by: Casey Bodley --- src/rgw/store/dbstore/common/dbstore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/store/dbstore/common/dbstore.h b/src/rgw/store/dbstore/common/dbstore.h index 553bf74a14b..4ef758e14d2 100644 --- a/src/rgw/store/dbstore/common/dbstore.h +++ b/src/rgw/store/dbstore/common/dbstore.h @@ -310,7 +310,7 @@ struct DBOpLCHeadPrepareInfo { struct DBOpPrepareInfo { DBOpUserPrepareInfo user; - std::string query_str = ":query_str"; + std::string_view query_str; // view into DBOpInfo::query_str DBOpBucketPrepareInfo bucket; DBOpObjectPrepareInfo obj; DBOpObjectDataPrepareInfo obj_data; -- 2.39.5