Skip to content

Commit f36f573

Browse files
committed
cc userver: fix some warnings detected by clang-tidy16
1 parent 6b2c13d commit f36f573

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

postgresql/src/storages/postgres/dsn.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ DsnList SplitByHost(const Dsn& dsn) {
142142
if (!ports.empty()) {
143143
options << " port=" << ports.front();
144144
}
145-
res.push_back(Dsn{options.str()});
145+
res.emplace_back(options.str());
146146
} else {
147147
if (ports.size() > 1 && ports.size() != hosts.size()) {
148148
throw InvalidDSN{DsnMaskPassword(dsn), "Invalid port options count"};
@@ -157,7 +157,7 @@ DsnList SplitByHost(const Dsn& dsn) {
157157
os << " port=" << ports[host - hosts.begin()];
158158
}
159159
os << options.str();
160-
res.push_back(Dsn{os.str()});
160+
res.emplace_back(os.str());
161161
}
162162
}
163163

redis/src/storages/redis/impl/sentinel_impl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ bool SentinelImpl::SetConnectionInfo(
764764

765765
if (changed) {
766766
std::vector<std::string> conn_strs;
767+
conn_strs.reserve(info_iterator.second.size());
767768
for (const auto& conn_str : info_iterator.second)
768769
conn_strs.push_back(conn_str.Fulltext());
769770
LOG_INFO() << "Redis state changed for client=" << client_name_

redis/src/storages/redis/pubsub_redistest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ std::vector<redis::CommandControl> BuildTestData() {
9292
std::vector<redis::CommandControl> result;
9393

9494
// One default CC
95-
result.emplace_back(redis::CommandControl{});
95+
result.emplace_back();
9696

9797
return result;
9898
}

0 commit comments

Comments
 (0)