Преглед на файлове

filesystem: Use std::string's empty() function instead of comparing against a literal

This is simply a basic value check as opposed to potentially doing
string based operations (unlikely, but still, avoiding it is free).
Lioncash преди 8 години
родител
ревизия
abbf038191
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/core/hle/service/filesystem/filesystem.cpp

+ 1 - 1
src/core/hle/service/filesystem/filesystem.cpp

@@ -23,7 +23,7 @@ constexpr u64 EMULATED_SD_REPORTED_SIZE = 32000000000;
 
 static FileSys::VirtualDir GetDirectoryRelativeWrapped(FileSys::VirtualDir base,
                                                        const std::string& dir_name) {
-    if (dir_name == "." || dir_name == "" || dir_name == "/" || dir_name == "\\")
+    if (dir_name.empty() || dir_name == "." || dir_name == "/" || dir_name == "\\")
         return base;
 
     return base->GetDirectoryRelative(dir_name);