mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 08:15:37 +00:00
Replace Land::swap by move assignment
This commit is contained in:
parent
c88e9dee27
commit
0cb37742cb
2 changed files with 10 additions and 19 deletions
|
@ -332,22 +332,11 @@ namespace ESM
|
|||
|
||||
Land& Land::operator=(const Land& land)
|
||||
{
|
||||
Land tmp(land);
|
||||
swap(tmp);
|
||||
Land copy(land);
|
||||
*this = std::move(copy);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Land::swap(Land& land)
|
||||
{
|
||||
std::swap(mFlags, land.mFlags);
|
||||
std::swap(mX, land.mX);
|
||||
std::swap(mY, land.mY);
|
||||
std::swap(mContext, land.mContext);
|
||||
std::swap(mDataTypes, land.mDataTypes);
|
||||
std::swap(mLandData, land.mLandData);
|
||||
std::swap(mWnam, land.mWnam);
|
||||
}
|
||||
|
||||
const Land::LandData* Land::getLandData(int flags) const
|
||||
{
|
||||
if (!(flags & mDataTypes))
|
||||
|
|
|
@ -28,6 +28,14 @@ namespace ESM
|
|||
|
||||
Land() = default;
|
||||
|
||||
Land(const Land& land);
|
||||
|
||||
Land(Land&& other) = default;
|
||||
|
||||
Land& operator=(const Land& land);
|
||||
|
||||
Land& operator=(Land&& land) = default;
|
||||
|
||||
// Only first four bits seem to be used, don't know what they mean.
|
||||
std::uint32_t mFlags = 0;
|
||||
// Map coordinates.
|
||||
|
@ -138,12 +146,6 @@ namespace ESM
|
|||
/// Check if given data type is loaded
|
||||
bool isDataLoaded(int flags) const;
|
||||
|
||||
Land(const Land& land);
|
||||
|
||||
Land& operator=(const Land& land);
|
||||
|
||||
void swap(Land& land);
|
||||
|
||||
/// Return land data with at least the data types specified in \a flags loaded (if they
|
||||
/// are available). Will return a 0-pointer if there is no data for any of the
|
||||
/// specified types.
|
||||
|
|
Loading…
Reference in a new issue