From 9d21df8e1bca9ccfa1bcfcde3bc8f35473866166 Mon Sep 17 00:00:00 2001 From: Dylam De La Torre Date: Tue, 16 Nov 2021 20:38:14 +0100 Subject: Fix warnings shown by GCC (#47) * fix all warnings shown by GCC --- discord/guild.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'discord/guild.cpp') diff --git a/discord/guild.cpp b/discord/guild.cpp index 1c79a38..23a45ee 100644 --- a/discord/guild.cpp +++ b/discord/guild.cpp @@ -191,7 +191,8 @@ std::vector GuildData::GetSortedChannels(Snowflake ignore) const { std::vector GuildData::FetchRoles() const { if (!Roles.has_value()) return {}; std::vector 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; -- cgit v1.2.3