diff --git a/src/dpp/guild.cpp b/src/dpp/guild.cpp index 20bd93a7d3..240122ea6f 100644 --- a/src/dpp/guild.cpp +++ b/src/dpp/guild.cpp @@ -248,7 +248,7 @@ std::string guild_member::build_json(bool with_id) const { } if (this->flags & gm_roles_action) { - j["roles"] = {}; + j["roles"] = {}; for (const auto & role : this->roles) { j["roles"].push_back(std::to_string(role)); } diff --git a/src/dpp/role.cpp b/src/dpp/role.cpp index 8c14160d89..24147055d4 100644 --- a/src/dpp/role.cpp +++ b/src/dpp/role.cpp @@ -413,7 +413,7 @@ members_container role::get_members() const { } for (auto & m : g->members) { /* Iterate all members and use std::find on their role list to see who has this role */ - auto r = m.second.get_roles(); + const auto& r = m.second.get_roles(); auto i = std::find(r.begin(), r.end(), this->id); if (i != r.end()) { gm[m.second.user_id] = m.second;