mirror of
https://github.com/matrix-construct/construct
synced 2025-02-18 01:30:12 +01:00
ircd::db: Use reference to prevent string copy.
ircd:Ⓜ️ Fix reference/copy related warnings in clang-10.
This commit is contained in:
parent
31bd80a6d1
commit
d371fba034
7 changed files with 9 additions and 9 deletions
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue