mirror of https://github.com/OpenTTD/OpenTTD
Codechange: remove operator!=s that are synthesized
parent
760b8f74b7
commit
04d53ed6f5
|
@ -168,7 +168,6 @@ struct CargoSpec {
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator==(const Iterator &other) const { return this->index == other.index; }
|
bool operator==(const Iterator &other) const { return this->index == other.index; }
|
||||||
bool operator!=(const Iterator &other) const { return !(*this == other); }
|
|
||||||
CargoSpec * operator*() const { return CargoSpec::Get(this->index); }
|
CargoSpec * operator*() const { return CargoSpec::Get(this->index); }
|
||||||
Iterator & operator++() { this->index++; this->ValidateIndex(); return *this; }
|
Iterator & operator++() { this->index++; this->ValidateIndex(); return *this; }
|
||||||
|
|
||||||
|
|
|
@ -315,7 +315,6 @@ struct SetBitIterator {
|
||||||
{
|
{
|
||||||
return this->bitset == other.bitset;
|
return this->bitset == other.bitset;
|
||||||
}
|
}
|
||||||
bool operator!=(const Iterator &other) const { return !(*this == other); }
|
|
||||||
Tbitpos operator*() const { return this->bitpos; }
|
Tbitpos operator*() const { return this->bitpos; }
|
||||||
Iterator & operator++() { this->Next(); this->Validate(); return *this; }
|
Iterator & operator++() { this->Next(); this->Validate(); return *this; }
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,6 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator==(const PoolIterator &other) const { return this->index == other.index; }
|
bool operator==(const PoolIterator &other) const { return this->index == other.index; }
|
||||||
bool operator!=(const PoolIterator &other) const { return !(*this == other); }
|
|
||||||
T * operator*() const { return T::Get(this->index); }
|
T * operator*() const { return T::Get(this->index); }
|
||||||
PoolIterator & operator++() { this->index++; this->ValidateIndex(); return *this; }
|
PoolIterator & operator++() { this->index++; this->ValidateIndex(); return *this; }
|
||||||
|
|
||||||
|
@ -206,7 +205,6 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator==(const PoolIteratorFiltered &other) const { return this->index == other.index; }
|
bool operator==(const PoolIteratorFiltered &other) const { return this->index == other.index; }
|
||||||
bool operator!=(const PoolIteratorFiltered &other) const { return !(*this == other); }
|
|
||||||
T * operator*() const { return T::Get(this->index); }
|
T * operator*() const { return T::Get(this->index); }
|
||||||
PoolIteratorFiltered & operator++() { this->index++; this->ValidateIndex(); return *this; }
|
PoolIteratorFiltered & operator++() { this->index++; this->ValidateIndex(); return *this; }
|
||||||
|
|
||||||
|
|
|
@ -618,11 +618,6 @@ struct ScenarioIdentifier {
|
||||||
{
|
{
|
||||||
return this->scenid == other.scenid && this->md5sum == other.md5sum;
|
return this->scenid == other.scenid && this->md5sum == other.md5sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator != (const ScenarioIdentifier &other) const
|
|
||||||
{
|
|
||||||
return !(*this == other);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -217,7 +217,6 @@ private:
|
||||||
|
|
||||||
explicit Iterator(TileIndex index) : index(index) {}
|
explicit Iterator(TileIndex index) : index(index) {}
|
||||||
bool operator==(const Iterator &other) const { return this->index == other.index; }
|
bool operator==(const Iterator &other) const { return this->index == other.index; }
|
||||||
bool operator!=(const Iterator &other) const { return !(*this == other); }
|
|
||||||
Tile operator*() const { return this->index; }
|
Tile operator*() const { return this->index; }
|
||||||
Iterator & operator++() { this->index++; return *this; }
|
Iterator & operator++() { this->index++; return *this; }
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -30,14 +30,9 @@ struct DestinationID {
|
||||||
constexpr BaseType base() const noexcept { return this->value; }
|
constexpr BaseType base() const noexcept { return this->value; }
|
||||||
|
|
||||||
constexpr bool operator ==(const DestinationID &destination) const { return this->value == destination.value; }
|
constexpr bool operator ==(const DestinationID &destination) const { return this->value == destination.value; }
|
||||||
constexpr bool operator !=(const DestinationID &destination) const { return this->value != destination.value; }
|
|
||||||
constexpr bool operator ==(const StationID &station) const { return this->value == station; }
|
constexpr bool operator ==(const StationID &station) const { return this->value == station; }
|
||||||
constexpr bool operator !=(const StationID &station) const { return this->value != station; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr bool operator ==(const StationID &station, const DestinationID &destination) { return destination == station; }
|
|
||||||
constexpr bool operator !=(const StationID &station, const DestinationID &destination) { return destination != station; }
|
|
||||||
|
|
||||||
/** Invalid vehicle order index (sentinel) */
|
/** Invalid vehicle order index (sentinel) */
|
||||||
static const VehicleOrderID INVALID_VEH_ORDER_ID = 0xFF;
|
static const VehicleOrderID INVALID_VEH_ORDER_ID = 0xFF;
|
||||||
/** Last valid VehicleOrderID. */
|
/** Last valid VehicleOrderID. */
|
||||||
|
|
|
@ -30,7 +30,6 @@ struct WaterRegionPatchDesc
|
||||||
TWaterRegionPatchLabel label; ///< Unique label identifying the patch within the region
|
TWaterRegionPatchLabel label; ///< Unique label identifying the patch within the region
|
||||||
|
|
||||||
bool operator==(const WaterRegionPatchDesc &other) const { return x == other.x && y == other.y && label == other.label; }
|
bool operator==(const WaterRegionPatchDesc &other) const { return x == other.x && y == other.y && label == other.label; }
|
||||||
bool operator!=(const WaterRegionPatchDesc &other) const { return !(*this == other); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,7 +45,6 @@ struct WaterRegionDesc
|
||||||
WaterRegionDesc(const WaterRegionPatchDesc &water_region_patch) : x(water_region_patch.x), y(water_region_patch.y) {}
|
WaterRegionDesc(const WaterRegionPatchDesc &water_region_patch) : x(water_region_patch.x), y(water_region_patch.y) {}
|
||||||
|
|
||||||
bool operator==(const WaterRegionDesc &other) const { return x == other.x && y == other.y; }
|
bool operator==(const WaterRegionDesc &other) const { return x == other.x && y == other.y; }
|
||||||
bool operator!=(const WaterRegionDesc &other) const { return !(*this == other); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int CalculateWaterRegionPatchHash(const WaterRegionPatchDesc &water_region_patch);
|
int CalculateWaterRegionPatchHash(const WaterRegionPatchDesc &water_region_patch);
|
||||||
|
|
|
@ -152,13 +152,6 @@ public:
|
||||||
{
|
{
|
||||||
return this->tile == rhs.tile;
|
return this->tile == rhs.tile;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Inequality comparison.
|
|
||||||
*/
|
|
||||||
bool operator !=(const TileIterator &rhs) const
|
|
||||||
{
|
|
||||||
return this->tile != rhs.tile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Equality comparison.
|
* Equality comparison.
|
||||||
|
@ -167,13 +160,6 @@ public:
|
||||||
{
|
{
|
||||||
return this->tile == rhs;
|
return this->tile == rhs;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Inequality comparison.
|
|
||||||
*/
|
|
||||||
bool operator !=(const TileIndex &rhs) const
|
|
||||||
{
|
|
||||||
return this->tile != rhs;
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::unique_ptr<TileIterator> Create(TileIndex corner1, TileIndex corner2, bool diagonal);
|
static std::unique_ptr<TileIterator> Create(TileIndex corner1, TileIndex corner2, bool diagonal);
|
||||||
};
|
};
|
||||||
|
|
|
@ -179,12 +179,6 @@ struct CargoSummaryItem {
|
||||||
uint amount; ///< Amount that is carried
|
uint amount; ///< Amount that is carried
|
||||||
StationID source; ///< One of the source stations
|
StationID source; ///< One of the source stations
|
||||||
|
|
||||||
/** Used by CargoSummary::Find() and similar functions */
|
|
||||||
inline bool operator != (const CargoSummaryItem &other) const
|
|
||||||
{
|
|
||||||
return this->cargo != other.cargo || this->subtype != other.subtype;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Used by std::find() and similar functions */
|
/** Used by std::find() and similar functions */
|
||||||
inline bool operator == (const CargoSummaryItem &other) const
|
inline bool operator == (const CargoSummaryItem &other) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -141,11 +141,6 @@ struct VehicleSpriteSeq {
|
||||||
return this->count == other.count && MemCmpT<PalSpriteID>(this->seq, other.seq, this->count) == 0;
|
return this->count == other.count && MemCmpT<PalSpriteID>(this->seq, other.seq, this->count) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const VehicleSpriteSeq &other) const
|
|
||||||
{
|
|
||||||
return !this->operator==(other);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether the sequence contains any sprites.
|
* Check whether the sequence contains any sprites.
|
||||||
*/
|
*/
|
||||||
|
@ -1050,7 +1045,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const OrderIterator &other) const { return this->order == other.order; }
|
bool operator==(const OrderIterator &other) const { return this->order == other.order; }
|
||||||
bool operator!=(const OrderIterator &other) const { return !(*this == other); }
|
|
||||||
Order * operator*() const { return this->order; }
|
Order * operator*() const { return this->order; }
|
||||||
OrderIterator & operator++()
|
OrderIterator & operator++()
|
||||||
{
|
{
|
||||||
|
|
|
@ -665,16 +665,6 @@ struct RefitOption {
|
||||||
uint8_t subtype; ///< Subcargo to use
|
uint8_t subtype; ///< Subcargo to use
|
||||||
StringID string; ///< GRF-local String to display for the cargo
|
StringID string; ///< GRF-local String to display for the cargo
|
||||||
|
|
||||||
/**
|
|
||||||
* Inequality operator for #RefitOption.
|
|
||||||
* @param other Compare to this #RefitOption.
|
|
||||||
* @return True if both #RefitOption are different.
|
|
||||||
*/
|
|
||||||
inline bool operator != (const RefitOption &other) const
|
|
||||||
{
|
|
||||||
return other.cargo != this->cargo || other.string != this->string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Equality operator for #RefitOption.
|
* Equality operator for #RefitOption.
|
||||||
* @param other Compare to this #RefitOption.
|
* @param other Compare to this #RefitOption.
|
||||||
|
|
|
@ -872,7 +872,6 @@ public:
|
||||||
explicit WindowIterator(const Window *w) : it(w->z_position) {}
|
explicit WindowIterator(const Window *w) : it(w->z_position) {}
|
||||||
|
|
||||||
bool operator==(const WindowIterator &other) const { return this->it == other.it; }
|
bool operator==(const WindowIterator &other) const { return this->it == other.it; }
|
||||||
bool operator!=(const WindowIterator &other) const { return !(*this == other); }
|
|
||||||
Window * operator*() const { return *this->it; }
|
Window * operator*() const { return *this->it; }
|
||||||
WindowIterator & operator++() { this->Next(); this->Validate(); return *this; }
|
WindowIterator & operator++() { this->Next(); this->Validate(); return *this; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue