Skip to content

Commit

Permalink
make name more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
ASpoonPlaysGames committed Aug 27, 2024
1 parent 0665454 commit 5c1cd40
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions primedev/core/filesystem/rpakfilesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ void PakLoadManager::TrackModPaks(Mod& mod)
// Untracks all paks that aren't currently loaded and are marked for unload.
void PakLoadManager::CleanUpUnloadedPaks()
{
auto fnPredicate = [](ModPak_t& pak) -> bool { return pak.m_markedForDelete && pak.m_handle == PakHandle::INVALID; };
auto fnRemovePredicate = [](ModPak_t& pak) -> bool { return pak.m_markedForDelete && pak.m_handle == PakHandle::INVALID; };

m_modPaks.erase(std::remove_if(m_modPaks.begin(), m_modPaks.end(), fnPredicate), m_modPaks.end());
m_modPaks.erase(std::remove_if(m_modPaks.begin(), m_modPaks.end(), fnRemovePredicate), m_modPaks.end());
}

// Unloads all paks that are marked for unload.
Expand Down Expand Up @@ -189,9 +189,9 @@ void PakLoadManager::OnPakUnloading(PakHandle handle)
if (IsVanillaCall())
{
// remove entry from loaded vanilla rpaks
auto fnPredicate = [handle](std::pair<std::string, PakHandle>& pair) -> bool { return pair.second == handle; };
auto fnRemovePredicate = [handle](std::pair<std::string, PakHandle>& pair) -> bool { return pair.second == handle; };

m_vanillaPaks.erase(std::remove_if(m_vanillaPaks.begin(), m_vanillaPaks.end(), fnPredicate), m_vanillaPaks.end());
m_vanillaPaks.erase(std::remove_if(m_vanillaPaks.begin(), m_vanillaPaks.end(), fnRemovePredicate), m_vanillaPaks.end());

// no need to handle aliasing here, if vanilla wants it gone, it's gone
}
Expand Down Expand Up @@ -305,7 +305,7 @@ void PakLoadManager::UnloadDependentPaks(PakHandle handle)
++m_reentranceCounter;
const ScopeGuard guard([&]() { --m_reentranceCounter; });

auto fnPredicate = [&](std::pair<PakHandle, size_t>& pair) -> bool
auto fnRemovePredicate = [&](std::pair<PakHandle, size_t>& pair) -> bool
{
if (pair.first != handle)
return false;
Expand All @@ -322,7 +322,7 @@ void PakLoadManager::UnloadDependentPaks(PakHandle handle)

return true;
};
m_dependentPaks.erase(std::remove_if(m_dependentPaks.begin(), m_dependentPaks.end(), fnPredicate), m_dependentPaks.end());
m_dependentPaks.erase(std::remove_if(m_dependentPaks.begin(), m_dependentPaks.end(), fnRemovePredicate), m_dependentPaks.end());
}

// Handles aliases for rpaks defined in rpak.json, effectively redirecting an rpak load to a different path.
Expand Down

0 comments on commit 5c1cd40

Please sign in to comment.