Fix various explicitness, laziness, hard codes
This commit is contained in:
+4
-6
@@ -1603,15 +1603,14 @@ bool fs::remove_all(const std::string& path, bool remove_root)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (entry.is_directory == false)
|
||||
if (!entry.is_directory)
|
||||
{
|
||||
if (!remove_file(path_append(path, entry.name)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (entry.is_directory == true)
|
||||
else
|
||||
{
|
||||
if (!remove_all(path_append(path, entry.name)))
|
||||
{
|
||||
@@ -1651,12 +1650,11 @@ u64 fs::get_dir_size(const std::string& path, u64 rounding_alignment)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (entry.is_directory == false)
|
||||
if (!entry.is_directory)
|
||||
{
|
||||
result += ::align(entry.size, rounding_alignment);
|
||||
}
|
||||
|
||||
if (entry.is_directory == true)
|
||||
else
|
||||
{
|
||||
const u64 size = get_dir_size(path_append(path, entry.name), rounding_alignment);
|
||||
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ namespace fmt
|
||||
template <typename T>
|
||||
std::string merge(const T& source, const std::string& separator)
|
||||
{
|
||||
if (!source.size())
|
||||
if (source.empty())
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace utils
|
||||
#else
|
||||
while ((m_file = ::shm_open("/rpcs3-mem1", O_RDWR | O_CREAT | O_EXCL, S_IWUSR | S_IRUSR)) == -1)
|
||||
{
|
||||
if (m_file == -1 && errno == EMFILE)
|
||||
if (errno == EMFILE)
|
||||
{
|
||||
fmt::throw_exception("Too many open files. Raise the limit and try again.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user