From 4fa8756791c8f0c2974eb2185ae21c185d4f1df2 Mon Sep 17 00:00:00 2001 From: Petr Mikheev Date: Tue, 12 Sep 2023 11:34:22 +0200 Subject: [PATCH] Silent coverity warning --- apps/openmw/mwworld/cellref.cpp | 2 +- apps/openmw/mwworld/cellref.hpp | 2 +- apps/openmw/mwworld/ptrregistry.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwworld/cellref.cpp b/apps/openmw/mwworld/cellref.cpp index 37e1be0ddf..35a04574ee 100644 --- a/apps/openmw/mwworld/cellref.cpp +++ b/apps/openmw/mwworld/cellref.cpp @@ -30,7 +30,7 @@ namespace MWWorld { } - const ESM::RefNum& CellRef::getRefNum() const + const ESM::RefNum& CellRef::getRefNum() const noexcept { return std::visit(ESM::VisitOverload{ [&](const ESM4::Reference& ref) -> const ESM::RefNum& { return ref.mId; }, diff --git a/apps/openmw/mwworld/cellref.hpp b/apps/openmw/mwworld/cellref.hpp index 73e721278e..1943fd9b54 100644 --- a/apps/openmw/mwworld/cellref.hpp +++ b/apps/openmw/mwworld/cellref.hpp @@ -27,7 +27,7 @@ namespace MWWorld explicit CellRef(const ESM4::ActorCharacter& ref); // Note: Currently unused for items in containers - const ESM::RefNum& getRefNum() const; + const ESM::RefNum& getRefNum() const noexcept; // Returns RefNum. // If RefNum is not set, assigns a generated one and changes the "lastAssignedRefNum" counter. diff --git a/apps/openmw/mwworld/ptrregistry.hpp b/apps/openmw/mwworld/ptrregistry.hpp index 3b535a220c..b640a22bfe 100644 --- a/apps/openmw/mwworld/ptrregistry.hpp +++ b/apps/openmw/mwworld/ptrregistry.hpp @@ -49,7 +49,7 @@ namespace MWWorld if (!refNum.isSet()) return; auto it = mIndex.find(refNum); - if (it != mIndex.end() && it->second.getBase() == &ref) + if (it != mIndex.end() && it->second.mRef == &ref) { mIndex.erase(it); ++mRevision;