File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed
Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -1211,24 +1211,15 @@ inline constexpr bool operator!=(const T& x, const uint<N>& y) noexcept
12111211 return uint<N>(x) != y;
12121212}
12131213
1214- #if !defined(_MSC_VER) || _MSC_VER < 1916 // This kills MSVC 2017 compiler.
1215- inline constexpr bool operator <(const uint256& x, const uint256& y) noexcept
1216- {
1217- auto xp = uint128{x[2 ], x[3 ]};
1218- auto yp = uint128{y[2 ], y[3 ]};
1219- if (xp == yp)
1220- {
1221- xp = uint128{x[0 ], x[1 ]};
1222- yp = uint128{y[0 ], y[1 ]};
1223- }
1224- return xp < yp;
1225- }
1226- #endif
1227-
12281214template <unsigned N>
12291215inline constexpr bool operator <(const uint<N>& x, const uint<N>& y) noexcept
12301216{
1231- return subc (x, y).carry ;
1217+ for (auto i = uint<N>::num_words - 1 ; i > 0 ; --i)
1218+ {
1219+ if (x[i] != y[i])
1220+ return x[i] < y[i];
1221+ }
1222+ return x[0 ] < y[0 ];
12321223}
12331224
12341225template <unsigned N, typename T,
You can’t perform that action at this time.
0 commit comments