From ca3f52f16030d233c57600365f7f1cfc879ac927 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sat, 23 Sep 2023 23:00:20 -0400 Subject: code deduplication --- src/discord/store.hpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/discord/store.hpp') diff --git a/src/discord/store.hpp b/src/discord/store.hpp index ccf8d3e..01401f6 100644 --- a/src/discord/store.hpp +++ b/src/discord/store.hpp @@ -79,18 +79,7 @@ public: std::vector r; r.reserve(size); while (s.FetchOne()) { - UserData u; - s.Get(0, u.ID); - s.Get(1, u.Username); - s.Get(2, u.Discriminator); - s.Get(3, u.Avatar); - s.Get(4, u.IsBot); - s.Get(5, u.IsSystem); - s.Get(6, u.IsMFAEnabled); - s.Get(7, u.PremiumType); - s.Get(8, u.PublicFlags); - s.Get(9, u.GlobalName); - r.push_back(u); + r.push_back(GetUserBound(&s)); } printf("fetched %llu\n", r.size()); return r; @@ -286,6 +275,7 @@ private: sqlite3_stmt *m_stmt; }; + UserData GetUserBound(Statement *stmt) const; Message GetMessageBound(std::unique_ptr &stmt) const; static RoleData GetRoleBound(std::unique_ptr &stmt); -- cgit v1.2.3