diff options
Diffstat (limited to 'discord/store.cpp')
-rw-r--r-- | discord/store.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/discord/store.cpp b/discord/store.cpp index e7715b4..159e3dd 100644 --- a/discord/store.cpp +++ b/discord/store.cpp @@ -261,7 +261,7 @@ void Store::SetGuildMember(Snowflake guild_id, Snowflake user_id, const GuildMem s->Bind(9, data.IsPending); if (!s->Insert()) - fprintf(stderr, "member insert failed for %" PRIu64 "/% " PRIu64 ": %s\n", static_cast<uint64_t>(user_id), static_cast<uint64_t>(guild_id), m_db.ErrStr()); + fprintf(stderr, "member insert failed for %" PRIu64 "/%" PRIu64 ": %s\n", static_cast<uint64_t>(user_id), static_cast<uint64_t>(guild_id), m_db.ErrStr()); s->Reset(); @@ -661,7 +661,7 @@ std::optional<ChannelData> Store::GetChannel(Snowflake id) const { s->Get(0, r); } s->Reset(); - if (recipients.size() > 0) + if (!recipients.empty()) r.RecipientIDs = std::move(recipients); } @@ -2173,6 +2173,10 @@ int Store::Statement::Bind(int index, size_t num) { return m_db->SetError(sqlite3_bind_int64(m_stmt, index, num)); } +int Store::Statement::Bind(int index, Snowflake id) { + return m_db->SetError(sqlite3_bind_int64(m_stmt, index, static_cast<sqlite3_int64>(id))); +} + int Store::Statement::Bind(int index, const char *str, size_t len) { if (len == -1) len = strlen(str); return m_db->SetError(sqlite3_bind_blob(m_stmt, index, str, len, SQLITE_TRANSIENT)); |