File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 55#include < stdexcept>
66
77bool operator ==(const in6_addr& l, const in6_addr& r) {
8- return l.__u6_addr .__u6_addr32 [0 ] == r.__u6_addr .__u6_addr32 [0 ]
9- && l.__u6_addr .__u6_addr32 [1 ] == r.__u6_addr .__u6_addr32 [1 ]
10- && l.__u6_addr .__u6_addr32 [2 ] == r.__u6_addr .__u6_addr32 [2 ]
11- && l.__u6_addr .__u6_addr32 [3 ] == r.__u6_addr .__u6_addr32 [3 ];
8+ const uint64_t * const l_array = reinterpret_cast <const uint64_t *>(&l);
9+ const uint64_t * const r_array = reinterpret_cast <const uint64_t *>(&r);
10+ return l_array[0 ] == r_array[0 ] && l_array[1 ] == r_array[1 ];
1211}
1312
1413bool operator !=(const in6_addr& l, const in6_addr& r) {
15- return l.__u6_addr .__u6_addr32 [0 ] != r.__u6_addr .__u6_addr32 [0 ]
16- || l.__u6_addr .__u6_addr32 [1 ] != r.__u6_addr .__u6_addr32 [1 ]
17- || l.__u6_addr .__u6_addr32 [2 ] != r.__u6_addr .__u6_addr32 [2 ]
18- || l.__u6_addr .__u6_addr32 [3 ] != r.__u6_addr .__u6_addr32 [3 ];
14+ const uint64_t * const l_array = reinterpret_cast <const uint64_t *>(&l);
15+ const uint64_t * const r_array = reinterpret_cast <const uint64_t *>(&r);
16+ return l_array[0 ] != r_array[0 ] || l_array[1 ] != r_array[1 ];
1917}
2018
2119namespace clickhouse {
You can’t perform that action at this time.
0 commit comments