refactor: PVS-Studio warnings fixes
This commit is contained in:
@@ -4,12 +4,9 @@
|
||||
|
||||
using namespace scripting;
|
||||
|
||||
static ItemDef* get_item_def(lua::State* L, int idx) {
|
||||
static const ItemDef* get_item_def(lua::State* L, int idx) {
|
||||
auto indices = content->getIndices();
|
||||
auto id = lua::tointeger(L, idx);
|
||||
if (static_cast<size_t>(id) >= indices->items.count()) {
|
||||
return nullptr;
|
||||
}
|
||||
return indices->items.get(id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user