Revert "fix: optimization: Various PVS-Studio warnings"

This commit is contained in:
MihailRis
2024-08-02 14:51:44 +03:00
committed by GitHub
parent a7ef7bb365
commit ba046a52c0
90 changed files with 259 additions and 274 deletions
+2 -1
View File
@@ -38,7 +38,8 @@ ContentGfxCache::ContentGfxCache(const Content* content, Assets* assets) : conte
}
}
ContentGfxCache::~ContentGfxCache() = default;
ContentGfxCache::~ContentGfxCache() {
}
const Content* ContentGfxCache::getContent() const {
return content;
+2 -1
View File
@@ -81,7 +81,8 @@ LevelFrontend::LevelFrontend(
);
}
LevelFrontend::~LevelFrontend() = default;
LevelFrontend::~LevelFrontend() {
}
Level* LevelFrontend::getLevel() const {
return level;
+2 -2
View File
@@ -314,7 +314,7 @@ void Hud::openInventory() {
}
void Hud::openInventory(
const glm::ivec3& block,
glm::ivec3 block,
UiDocument* doc,
std::shared_ptr<Inventory> blockinv,
bool playerInventory
@@ -406,9 +406,9 @@ void Hud::add(const HudElement& element) {
using namespace dynamic;
gui->add(element.getNode());
auto invview = std::dynamic_pointer_cast<InventoryView>(element.getNode());
auto document = element.getDocument();
if (document) {
auto invview = std::dynamic_pointer_cast<InventoryView>(element.getNode());
auto inventory = invview ? invview->getInventory() : nullptr;
std::vector<Value> args;
args.emplace_back(inventory ? inventory.get()->getId() : 0);
+3 -3
View File
@@ -140,12 +140,12 @@ public:
/// @brief Show block inventory in inventory-mode
/// @param block block position
/// @param doc block ui layout
/// @param blockinv block inventory
/// @param blockInv block inventory
/// @param playerInventory show player inventory too
void openInventory(
const glm::ivec3& block,
glm::ivec3 block,
UiDocument* doc,
std::shared_ptr<Inventory> blockinv,
std::shared_ptr<Inventory> blockInv,
bool playerInventory
);
+1 -1
View File
@@ -146,7 +146,7 @@ void langs::load(const fs::path& resdir,
if (locale != fallback) {
load(resdir, locale, packs, *lang.get());
}
current = std::move(lang);
current.reset(lang.release());
}
void langs::setup(const fs::path& resdir,