Revisit need for compare in base_uint.h #2525
Labels
Good First Issue
Great issue for a new contributor
Low Priority
Reviewed
Tech Debt
Non-urgent improvements
@nbougalis brought up a good point about whether we actually need
compare
inbase_uint.h
after #2514.This ticket should revisit this and see if it is truly needed. It seems that the underlying representation of
base_uint
should form a natural total ordering. So, ideally, these steps would form a natural transition of removingcompare
:base_uint.h
delegate to those ofstd::array
which form a lexicographical comparison. You can just implementoperator<
andoperator==
as friends in the class definition and the other four outside as non-friends. Change the tests inbase_uint_test.cpp
to use the comparison operators directly instead ofcompare
.compare
function inIssue.cpp
to leverage these comparison operators directly inbase_uint.h
.compare
function object frombase_uint.h
around insideaddRaw
inTxMeta.cpp
.compare
inbase_uint.h
.The text was updated successfully, but these errors were encountered: