RefId's mId can't be get as mutable from the outside

also removed useless operator= defintion
iwyu_full
fteppe 2 years ago committed by florent.teppe
parent d6d2a37d03
commit ee941f9b09

@ -431,7 +431,6 @@ namespace MWWorld
{
ESM::RefId& refId = refIDs[value.mRefID];
// We manually lower case IDs here for the time being to improve performance.
Misc::StringUtils::lowerCaseInPlace(refId.getRefIdString());
++mRefCount[std::move(refId)];
}
};

@ -12,16 +12,16 @@ namespace ESM
void clear() { mId.clear(); }
bool empty() const { return mId.empty(); }
void swap(RefId& rhs) { mId.swap(rhs.mId); }
bool operator==(const RefId& rhs) const { return mId == rhs.mId; }
void operator=(const RefId& rhs) { mId = rhs.mId; }
bool operator==(const RefId& rhs) const { return ciEqual(*this, rhs); }
bool operator<(const RefId& rhs) const { return mId < rhs.mId; }
bool operator>(const RefId& rhs) const { return mId > rhs.mId; }
static bool ciEqual(const RefId& left, const RefId& right);
friend std::ostream& operator<<(std::ostream& os, const RefId& dt);
static RefId stringRefId(const std::string_view& id); //The
std::string& getRefIdString() { return mId; }
//The 2 following functions are used to move back and forth between string and RefID. Used for hard coded RefIds that are as string in the code.
//For serialization, and display. Using explicit conversions make it very clear where in the code we need to convert from string to RefId and Vice versa.
static RefId stringRefId(const std::string_view& id);
const std::string& getRefIdString() const { return mId; }

@ -82,7 +82,6 @@ namespace EsmLoader
T record;
bool deleted = false;
record.load(reader, deleted);
Misc::StringUtils::lowerCaseInPlace(record.mId.getRefIdString());
if (Misc::ResourceHelpers::isHiddenMarker(record.mId.getRefIdString()))
return;
records.emplace_back(deleted, std::move(record));

Loading…
Cancel
Save