Skip to content

Commit

Permalink
Use fmt format instead of ostringstream
Browse files Browse the repository at this point in the history
  • Loading branch information
ramon-bernardo committed Jul 25, 2022
1 parent f42875b commit f8f9b43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/iologindata.cpp
Expand Up @@ -1112,10 +1112,10 @@ std::vector<time_t> IOLoginData::getUnjustifiedDates(const std::string& name, ti
{
std::vector<time_t> killsList;
Database& db = Database::getInstance();
std::ostringstream query;
query << "SELECT `time` FROM `player_deaths` WHERE `killed_by` = " << db.escapeString(name)
<< " AND `unjustified` = 1 AND `time` >= " << offsetTime - 30 * 86400;
DBResult_ptr result = db.storeQuery(query.str());

DBResult_ptr result = db.storeQuery(
fmt::format("SELECT `time` FROM `player_deaths` WHERE `killed_by` = {:s} AND `unjustified` = 1 AND `time` >= {:d}",
db.escapeString(name), offsetTime - 30 * 86400));

if (result) {
do {
Expand Down

0 comments on commit f8f9b43

Please sign in to comment.