0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-29 00:03:45 +02:00

ircd::db: Use reference to prevent string copy.

ircd:Ⓜ️ Fix reference/copy related warnings in clang-10.
This commit is contained in:
Jason Volk 2020-07-10 20:19:18 -07:00
parent 31bd80a6d1
commit d371fba034
7 changed files with 9 additions and 9 deletions

View file

@ -8794,7 +8794,7 @@ ircd::db::available()
fs::ls(dir)
};
for(const auto cpdir : checkpoints) try
for(const auto &cpdir : checkpoints) try
{
const auto checkpoint
{

View file

@ -86,7 +86,7 @@ ircd::m::push::match::match(const event &event,
return false;
}
for(const json::object &cond : json::get<"conditions"_>(rule))
for(const json::object cond : json::get<"conditions"_>(rule))
if(!match(event, push::cond(cond), opts))
return false;

View file

@ -569,7 +569,7 @@ try
std::vector<m::fed::key::server_key> queries;
queries.reserve(events.size());
for(const json::object &event : events)
for(const json::object event : events)
for(const auto &[server_name, signatures] : json::object(event["signatures"]))
for(const auto &[key_id, signature] : json::object(signatures))
queries.emplace_back(unquote(event.at("origin")), key_id);

View file

@ -217,7 +217,7 @@ try
// and topic keys.
size_t i(0);
for(const json::object &event : json::get<"initial_state"_>(c)) try
for(const json::object event : json::get<"initial_state"_>(c)) try
{
const json::string &type(event["type"]);
const json::string &state_key(event["state_key"]);
@ -282,7 +282,7 @@ try
// invitation vector
for(const json::string &_user_id : json::get<"invite"_>(c)) try
for(const json::string _user_id : json::get<"invite"_>(c)) try
{
json::iov content;
const json::iov::add is_direct // Conditionally add is_direct

View file

@ -148,7 +148,7 @@ handle_m_receipt_m_read(const m::room::id &room_id,
json::get<"data"_>(receipt)
};
for(const json::string &event_id : event_ids) try
for(const json::string event_id : event_ids) try
{
handle_m_receipt_m_read(room_id, user_id, event_id, data);
}

View file

@ -85,7 +85,7 @@ try
at<"content"_>(event).get("aliases")
};
for(const json::string &alias : aliases) try
for(const json::string alias : aliases) try
{
m::room::aliases::cache::set(alias, room_id);

View file

@ -456,7 +456,7 @@ ircd::net::dns::cache::for_each(const hostport &hp,
m::get(std::nothrow, event_idx, "content", [&state_key, &closure, &ret, &ts]
(const json::object &content)
{
for(const json::object &rr : json::array(content.get("")))
for(const json::object rr : json::array(content.get("")))
{
if(expired(rr, ts))
continue;
@ -497,7 +497,7 @@ ircd::net::dns::cache::for_each(const string_view &type,
m::get(std::nothrow, event_idx, "content", [&state_key, &closure, &ret, &ts]
(const json::object &content)
{
for(const json::object &rr : json::array(content.get("")))
for(const json::object rr : json::array(content.get("")))
{
if(expired(rr, ts))
continue;