pass delete paths by reference for trimming

This commit is contained in:
Stephen Birarda 2016-03-10 16:06:04 -08:00
parent 6ae5ed6588
commit 6f550292f4
2 changed files with 3 additions and 3 deletions

View file

@ -551,12 +551,12 @@ bool pathIsFolder(const AssetPath& path) {
return path.endsWith('/');
}
bool AssetServer::deleteMappings(const AssetPathList& paths) {
bool AssetServer::deleteMappings(AssetPathList& paths) {
// take a copy of the current mappings in case persistence of these deletes fails
auto oldMappings = _fileMappings;
// enumerate the paths to delete and remove them all
for (auto path : paths) {
for (auto& path : paths) {
path = path.trimmed();

View file

@ -55,7 +55,7 @@ private:
bool setMapping(AssetPath path, AssetHash hash);
/// Delete mapping `path`. Returns `true` if deletion of mappings succeeds, else `false`.
bool deleteMappings(const AssetPathList& paths);
bool deleteMappings(AssetPathList& paths);
/// Rename mapping from `oldPath` to `newPath`. Returns true if successful
bool renameMapping(AssetPath oldPath, AssetPath newPath);