mirror of
https://github.com/scummvm/scummvm.git
synced 2026-05-21 05:40:43 +00:00
DETECTION: Don't call appendComponent when it's not needed
This commit is contained in:
@@ -442,7 +442,7 @@ void AdvancedMetaEngineDetectionBase::composeFileHashMap(FileMap &allFiles, cons
|
||||
|
||||
for (const auto &file : fslist) {
|
||||
Common::String efname = Common::punycode_encodefilename(file.getName());
|
||||
Common::Path tstr = ((_flags & kADFlagMatchFullPaths) ? parentName : Common::Path()).appendComponent(efname);
|
||||
Common::Path tstr = (_flags & kADFlagMatchFullPaths) ? parentName.appendComponent(efname) : Common::Path(efname, Common::Path::kNoSeparator);
|
||||
|
||||
if (file.isDirectory()) {
|
||||
if (!_globsMap.contains(efname))
|
||||
@@ -459,7 +459,7 @@ void AdvancedMetaEngineDetectionBase::composeFileHashMap(FileMap &allFiles, cons
|
||||
// Strip any trailing dot
|
||||
if (efname.lastChar() == '.') {
|
||||
efname.deleteLastChar();
|
||||
tstr = ((_flags & kADFlagMatchFullPaths) ? parentName : Common::Path()).appendComponent(efname);
|
||||
tstr = (_flags & kADFlagMatchFullPaths) ? parentName.appendComponent(efname) : Common::Path(efname, Common::Path::kNoSeparator);
|
||||
}
|
||||
|
||||
debugC(9, kDebugGlobalDetection, "$$ ['%s'] ['%s'] in '%s", tstr.toString().c_str(), efname.c_str(), firstPathComponents(fslist.front().getPath().toString(), '/').c_str());
|
||||
|
||||
Reference in New Issue
Block a user