Skip to content

Commit

Permalink
Use simpler implementation of operator!=.
Browse files Browse the repository at this point in the history
Best practice to implement operator!= in terms of operator==.
  • Loading branch information
joto committed Feb 21, 2018
1 parent 798b738 commit 4b1e76f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/vtzero/property.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace vtzero {

/// properties are unequal if they do not contain them same key and value data.
inline constexpr bool operator!=(const property& lhs, const property& rhs) noexcept {
return lhs.key() != rhs.key() || lhs.value() != rhs.value();
return !(lhs == rhs);
}

} // namespace vtzero
Expand Down

0 comments on commit 4b1e76f

Please sign in to comment.