From 630ec36d1fcaa68805731c4ac6bc4123b173a8f0 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Wed, 30 Dec 2020 10:35:51 +0100 Subject: [PATCH] iterate in reverse order --- components/vfs/manager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/vfs/manager.cpp b/components/vfs/manager.cpp index c7abc2483..045fe3cf5 100644 --- a/components/vfs/manager.cpp +++ b/components/vfs/manager.cpp @@ -100,10 +100,10 @@ namespace VFS { std::string normalized = name; normalize_path(normalized, mStrict); - for(const auto archive : mArchives) + for(auto it = mArchives.rbegin(); it != mArchives.rend(); ++it) { - if(archive->contains(normalized, mStrict ? &strict_normalize_char : &nonstrict_normalize_char)) - return archive->getDescription(); + if((*it)->contains(normalized, mStrict ? &strict_normalize_char : &nonstrict_normalize_char)) + return (*it)->getDescription(); } return {}; }