fix: optimization: PVS-Studio warning V815
The 'empty()' method is more efficient for checking if a string is empty compared to comparing it with an empty string literal. The default constructor 'std::wstring()' is more efficient for creating an empty string compared to using a string literal. The 'clear()' method is more efficient for clearing a std::wstring compared to assigning it an empty string literal. Reported by: PVS-Studio Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
+1
-1
@@ -201,7 +201,7 @@ void World::deserialize(dynamic::Map* root) {
|
||||
generator = root->get("generator", generator);
|
||||
seed = root->get("seed", seed);
|
||||
|
||||
if (generator == "") {
|
||||
if (generator.empty()) {
|
||||
generator = WorldGenerators::getDefaultGeneratorID();
|
||||
}
|
||||
if (auto verobj = root->map("version")) {
|
||||
|
||||
Reference in New Issue
Block a user