Skip to content

Commit

Permalink
Fixed operator< in AvidaGP
Browse files Browse the repository at this point in the history
  • Loading branch information
mercere99 committed Dec 2, 2023
1 parent 6d5356b commit fdf4a2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/emp/hardware/AvidaGP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace emp {
Instruction & operator=(const Instruction &) = default;
Instruction & operator=(Instruction &&) = default;
bool operator<(const Instruction & in) const {
return std::tie(id, args) < std::tie(in.id, in.args);
return (id == in.id) ? (args < in.args) : (id < in.id);
}
bool operator==(const Instruction & in) const { return id == in.id && args == in.args; }
bool operator!=(const Instruction & in) const { return !(*this == in); }
Expand Down

0 comments on commit fdf4a2f

Please sign in to comment.