From: Casey Bodley Date: Mon, 21 Feb 2022 17:07:26 +0000 (-0500) Subject: rgw/dbstore: DBOpPrepareInfo::query_str is a view X-Git-Tag: v18.0.0~1338^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F45109%2Fhead;p=ceph.git 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 --- diff --git a/src/rgw/store/dbstore/common/dbstore.h b/src/rgw/store/dbstore/common/dbstore.h index 553bf74a14bc..4ef758e14d2f 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;