Fix warnings shown by GCC (#47)

* fix all warnings shown by GCC
This commit is contained in:
Dylam De La Torre
2021-11-16 20:38:14 +01:00
committed by GitHub
parent 108002248c
commit 9d21df8e1b
24 changed files with 65 additions and 76 deletions

View File

@@ -191,7 +191,8 @@ std::vector<Snowflake> GuildData::GetSortedChannels(Snowflake ignore) const {
std::vector<RoleData> GuildData::FetchRoles() const {
if (!Roles.has_value()) return {};
std::vector<RoleData> ret;
for (const auto thing : *Roles)
ret.reserve(Roles->size());
for (const auto &thing : *Roles)
ret.push_back(*Abaddon::Get().GetDiscordClient().GetRole(thing.ID));
std::sort(ret.begin(), ret.end(), [](const RoleData &a, const RoleData &b) -> bool {
return a.Position > b.Position;