Add macro definition AX_NO_DUP_SEARCH_PATH (#874)

This commit is contained in:
tkzcfc 2022-09-30 14:40:52 +08:00 committed by GitHub
parent 1263d05b76
commit 43cc814ffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -928,6 +928,7 @@ void FileUtils::addSearchPath(std::string_view searchpath, const bool front)
path += "/";
}
#ifdef AX_NO_DUP_SEARCH_PATH
auto it = std::find(_searchPathArray.begin(), _searchPathArray.end(), path);
if (it != _searchPathArray.end())
{
@ -939,6 +940,7 @@ void FileUtils::addSearchPath(std::string_view searchpath, const bool front)
_originalSearchPaths.erase(itOrigin);
}
}
#endif // AX_NO_DUP_SEARCH_PATH
if (front)
{