Skip to content

Commit

Permalink
skip non-files (#1690)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmosewaMC authored Dec 19, 2024
1 parent 0ae9eb4 commit 1ae21c4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions dCommon/GeneralUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,12 @@ std::u16string GeneralUtils::ReadWString(RakNet::BitStream& inStream) {

std::vector<std::string> GeneralUtils::GetSqlFileNamesFromFolder(const std::string_view folder) {
// Because we dont know how large the initial number before the first _ is we need to make it a map like so.
std::map<uint32_t, std::string> filenames{};
std::map<uint32_t, std::string> filenames{};
for (const auto& t : std::filesystem::directory_iterator(folder)) {
auto filename = t.path().filename().string();
const auto index = std::stoi(GeneralUtils::SplitString(filename, '_').at(0));
filenames.emplace(index, std::move(filename));
if (t.is_directory() || t.is_symlink()) continue;
auto filename = t.path().filename().string();
const auto index = std::stoi(GeneralUtils::SplitString(filename, '_').at(0));
filenames.emplace(index, std::move(filename));
}

// Now sort the map by the oldest migration.
Expand Down

0 comments on commit 1ae21c4

Please sign in to comment.