Skip to content

Commit

Permalink
Core/Updater: Fix gcc warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Shauren committed May 5, 2024
1 parent e7c0ea9 commit b288fce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/server/database/Updater/UpdateFetcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ void UpdateFetcher::CleanUp(AppliedFileStorage const& storage) const

void UpdateFetcher::UpdateState(std::string const& name, State const state) const
{
std::string const update = "UPDATE `updates` SET `state`=\'" + AppliedFileEntry::StateConvert(state) + "\' WHERE `name`=\"" + name + "\"";
std::string const update = Trinity::StringFormat(R"(UPDATE `updates` SET `state`='{}' WHERE `name`="{}")", AppliedFileEntry::StateConvert(state), name);

// Update database
_apply(update);
Expand Down
4 changes: 2 additions & 2 deletions src/server/database/Updater/UpdateFetcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ class TC_DATABASE_API UpdateFetcher

uint64 const timestamp;

static inline State StateConvert(std::string const& state)
static constexpr State StateConvert(std::string const& state)
{
return (state == "RELEASED") ? RELEASED : ARCHIVED;
}

static inline std::string StateConvert(State const state)
static constexpr std::string StateConvert(State const state)
{
return (state == RELEASED) ? "RELEASED" : "ARCHIVED";
}
Expand Down

0 comments on commit b288fce

Please sign in to comment.