Skip to content

Commit

Permalink
Derive operator!= from operator==
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Feb 15, 2025
1 parent 62309d5 commit e455dfa
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/create-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
path: rgbds-${{ env.version }}-macos.zip

linux:
runs-on: ubuntu-20.04 # Oldest supported, for best glibc compatibility.
runs-on: ubuntu-22.04 # Oldest supported, for best glibc compatibility.
steps:
- name: Get version from tag
shell: bash
Expand All @@ -112,7 +112,7 @@ jobs:
- name: Install deps
shell: bash
run: |
./.github/scripts/install_deps.sh ubuntu-20.04
./.github/scripts/install_deps.sh ubuntu-22.04
- name: Build binaries
run: |
make -kj WARNFLAGS="-Wall -Wextra -pedantic -static" PKG_CONFIG="pkg-config --static" Q=
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
unix:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-14]
os: [ubuntu-22.04, macos-14]
cxx: [g++, clang++]
buildsys: [make, cmake]
exclude:
Expand Down
1 change: 0 additions & 1 deletion include/gfx/rgba.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ struct Rgba {
}

bool operator==(Rgba const &rhs) const { return toCSS() == rhs.toCSS(); }
bool operator!=(Rgba const &rhs) const { return !operator==(rhs); }

// CGB colors are RGB555, so we use bit 15 to signify that the color is transparent instead
// Since the rest of the bits don't matter then, we return 0x8000 exactly.
Expand Down
2 changes: 0 additions & 2 deletions include/itertools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class EnumSeq {
auto operator*() const { return _value; }

bool operator==(Iterator const &rhs) const { return _value == rhs._value; }
bool operator!=(Iterator const &rhs) const { return !operator==(rhs); }
};

public:
Expand Down Expand Up @@ -59,7 +58,6 @@ class ZipIterator {
bool operator==(ZipIterator const &rhs) const {
return std::get<0>(_iters) == std::get<0>(rhs._iters);
}
bool operator!=(ZipIterator const &rhs) const { return !operator==(rhs); }
};

template<typename... Ts>
Expand Down
1 change: 0 additions & 1 deletion src/gfx/pal_packing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class AssignedProtos {
Iter() = default;

bool operator==(Iter const &rhs) const { return _iter == rhs._iter; }
bool operator!=(Iter const &rhs) const { return !operator==(rhs); }

Iter &operator++() {
++_iter;
Expand Down
1 change: 0 additions & 1 deletion src/gfx/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ class Png {
}

bool operator==(Iterator const &rhs) const { return coords() == rhs.coords(); }
bool operator!=(Iterator const &rhs) const { return !operator==(rhs); }
};

public:
Expand Down

0 comments on commit e455dfa

Please sign in to comment.