AGS: Common: fix warns and clang-tidy notices

- using braced initializers for returned invalid objects
partially from upstream 8aeda4b67bf24ce080b09255139e0f6b907a9a8f
This commit is contained in:
Walter Agazzi 2023-02-26 20:33:33 +01:00 committed by Thierry Crozat
parent 72592cc9e0
commit 8c6524a888

View File

@ -150,13 +150,13 @@ FindFileRecursive FindFileRecursive::Open(const String &path, const String &wild
FindFile fdir = FindFile::OpenDirs(path);
FindFile ffile = FindFile::OpenFiles(path, wildcard);
if (ffile.AtEnd() && fdir.AtEnd())
return FindFileRecursive(); // return invalid object
return {}; // return invalid object
FindFileRecursive ff;
ff._fdir = std::move(fdir);
ff._ffile = std::move(ffile);
// Try get the first matching entry
if (ff._ffile.AtEnd() && !ff.Next())
return FindFileRecursive(); // return invalid object
return {}; // return invalid object
ff._maxLevel = max_level;
ff._fullDir = path;
ff._curFile = ff._ffile.Current();