mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
refactor: PVS-Studio warnings fixes
This commit is contained in:
parent
7bc96affbb
commit
245b39be62
22 changed files with 311 additions and 302 deletions
|
|
@ -59,13 +59,25 @@ public:
|
|||
ContentUnitIndices(std::vector<T*> defs) : defs(std::move(defs)) {
|
||||
}
|
||||
|
||||
inline T* get(blockid_t id) const {
|
||||
inline const T* get(blockid_t id) const {
|
||||
if (id >= defs.size()) {
|
||||
return nullptr;
|
||||
}
|
||||
return defs[id];
|
||||
}
|
||||
|
||||
[[deprecated]]
|
||||
inline T* getWriteable(blockid_t id) const { // TODO: remove
|
||||
if (id >= defs.size()) {
|
||||
return nullptr;
|
||||
}
|
||||
return defs[id];
|
||||
}
|
||||
|
||||
inline const T& require(blockid_t id) const {
|
||||
return *defs.at(id);
|
||||
}
|
||||
|
||||
inline size_t count() const {
|
||||
return defs.size();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,11 +132,7 @@ fs::path ContentPack::findPack(
|
|||
if (fs::is_directory(folder)) {
|
||||
return folder;
|
||||
}
|
||||
folder = paths->getResources() / fs::path("content") / fs::path(name);
|
||||
if (fs::is_directory(folder)) {
|
||||
return folder; //-V523
|
||||
}
|
||||
return folder; // FIXME: V523 The 'then' statement is equivalent to the subsequent code fragment //-V523
|
||||
return paths->getResources() / fs::path("content") / fs::path(name);
|
||||
}
|
||||
|
||||
ContentPackRuntime::ContentPackRuntime(ContentPack info, scriptenv env)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue