| 496 | // This does not seem to be required for GetMinMaxSpaced(). |
| 497 | template <> |
| 498 | std::pair<int32_t, int32_t> |
| 499 | TypedComparatorImpl</*is_signed=*/false, Int32Type>::GetMinMax(const int32_t* values, |
| 500 | int64_t length) const { |
| 501 | DCHECK_GT(length, 0); |
| 502 | |
| 503 | const uint32_t* unsigned_values = reinterpret_cast<const uint32_t*>(values); |
| 504 | uint32_t min = std::numeric_limits<uint32_t>::max(); |
| 505 | uint32_t max = std::numeric_limits<uint32_t>::lowest(); |
| 506 | |
| 507 | for (int64_t i = 0; i < length; i++) { |
| 508 | const auto val = unsigned_values[i]; |
| 509 | min = std::min<uint32_t>(min, val); |
| 510 | max = std::max<uint32_t>(max, val); |
| 511 | } |
| 512 | |
| 513 | return {SafeCopy<int32_t>(min), SafeCopy<int32_t>(max)}; |
| 514 | } |
| 515 | |
| 516 | template <bool is_signed> |
| 517 | std::pair<ByteArray, ByteArray> GetMinMaxBinaryHelper( |