Перепись с const std::string& на std::string_view

This commit is contained in:
2026-01-29 09:33:38 +03:00
parent 91d20fcf01
commit 9a7c9b7e7c
11 changed files with 47 additions and 47 deletions
+4 -4
View File
@@ -11,7 +11,7 @@ MySQLUserTreatmentSchemesDAO::MySQLUserTreatmentSchemesDAO(mysqlx::Session& sess
}
std::vector<user_treatment_scheme_dto> MySQLUserTreatmentSchemesDAO::FindByUserUUID(
const std::string& user_uuid)
std::string_view user_uuid)
{
static const std::string query = R"(
SELECT
@@ -30,7 +30,7 @@ std::vector<user_treatment_scheme_dto> MySQLUserTreatmentSchemesDAO::FindByUserU
mysqlx::SqlResult result = session_
.sql(query)
.bind(user_uuid)
.bind(user_uuid.data())
.execute();
std::unordered_map<std::string, user_treatment_scheme_dto> scheme_map;
@@ -69,7 +69,7 @@ std::vector<user_treatment_scheme_dto> MySQLUserTreatmentSchemesDAO::FindByUserU
}
void MySQLUserTreatmentSchemesDAO::CreateUserTreatmentScheme(
const std::string& user_uuid,
std::string_view user_uuid,
const user_treatment_scheme_dto& dto)
{
session_.startTransaction();
@@ -85,7 +85,7 @@ void MySQLUserTreatmentSchemesDAO::CreateUserTreatmentScheme(
)")
.bind(
dto.uuid,
user_uuid,
user_uuid.data(),
dto.treatment_name,
dto.instructions
)