Iterates over input and for each group of kInt64DecimalDigits multiple out by the appropriate power of 10 necessary to add source parsed as uint64 and then adds the parsed value of source.
| 769 | // the appropriate power of 10 necessary to add source parsed as uint64 and |
| 770 | // then adds the parsed value of source. |
| 771 | static inline void ShiftAndAdd(std::string_view input, uint64_t out[], size_t out_size) { |
| 772 | for (size_t posn = 0; posn < input.size();) { |
| 773 | const size_t group_size = std::min(kInt64DecimalDigits, input.size() - posn); |
| 774 | const uint64_t multiple = kUInt64PowersOfTen[group_size]; |
| 775 | uint64_t chunk = 0; |
| 776 | ARROW_CHECK( |
| 777 | internal::ParseValue<UInt64Type>(input.data() + posn, group_size, &chunk)); |
| 778 | |
| 779 | for (size_t i = 0; i < out_size; ++i) { |
| 780 | uint128_t tmp = out[i]; |
| 781 | tmp *= multiple; |
| 782 | tmp += chunk; |
| 783 | out[i] = static_cast<uint64_t>(tmp & 0xFFFFFFFFFFFFFFFFULL); |
| 784 | chunk = static_cast<uint64_t>(tmp >> 64); |
| 785 | } |
| 786 | posn += group_size; |
| 787 | } |
| 788 | } |
| 789 | |
| 790 | namespace { |
| 791 |
no test coverage detected