| 549 | |
| 550 | template <typename TypeClass> |
| 551 | Status CompareBinary(const TypeClass&) { |
| 552 | const uint8_t* left_data = left_.GetValues<uint8_t>(2, 0); |
| 553 | const uint8_t* right_data = right_.GetValues<uint8_t>(2, 0); |
| 554 | |
| 555 | if (left_data != nullptr && right_data != nullptr) { |
| 556 | const auto compare_ranges = [&](int64_t left_offset, int64_t right_offset, |
| 557 | int64_t length) -> bool { |
| 558 | return memcmp(left_data + left_offset, right_data + right_offset, length) == 0; |
| 559 | }; |
| 560 | CompareWithOffsets<typename TypeClass::offset_type>(1, compare_ranges); |
| 561 | } else { |
| 562 | // One of the arrays is an array of empty strings and nulls. |
| 563 | // We just need to compare the offsets. |
| 564 | // (note we must not call memcmp() with null data pointers) |
| 565 | CompareWithOffsets<typename TypeClass::offset_type>(1, [](...) { return true; }); |
| 566 | } |
| 567 | return Status::OK(); |
| 568 | } |
| 569 | |
| 570 | template <typename TypeClass> |
| 571 | Status CompareList(const TypeClass&) { |