[Cleanup] Unconditional return in for loop in GetRaidByCharID() (#3179)

# Notes
- This is improper and should just check if we have no result, return `0`, otherwise return `row[0]` of the row we queried.
This commit is contained in:
Alex King 2023-04-03 17:23:32 -04:00 committed by GitHub
parent 6a80a061dd
commit 3e5d0a0601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2043,10 +2043,12 @@ uint32 Database::GetRaidIDByCharID(uint32 character_id) {
character_id character_id
); );
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
for (auto row = results.begin(); row != results.end(); ++row) { if (!results.Success() || !results.RowCount()) {
return Strings::ToUnsignedInt(row[0]); return 0;
} }
return 0;
auto row = results.begin();
return Strings::ToUnsignedInt(row[0]);
} }
int Database::CountInvSnapshots() { int Database::CountInvSnapshots() {