| 630 | static constexpr int32_t kMaxArity = 254; |
| 631 | |
| 632 | void call( |
| 633 | out_type<Array<T>>& out, |
| 634 | const arg_type<Variadic<Array<T>>>& arrays) { |
| 635 | BOLT_USER_CHECK_GE( |
| 636 | arrays.size(), |
| 637 | kMinArity, |
| 638 | "There must be {} or more arguments to concat", |
| 639 | kMinArity); |
| 640 | BOLT_USER_CHECK_LE( |
| 641 | arrays.size(), kMaxArity, "Too many arguments for concat function"); |
| 642 | int64_t elementCount = 0; |
| 643 | for (const auto& array : arrays) { |
| 644 | elementCount += array.value().size(); |
| 645 | } |
| 646 | out.reserve(elementCount); |
| 647 | for (const auto& array : arrays) { |
| 648 | out.add_items(array.value()); |
| 649 | } |
| 650 | } |
| 651 | |
| 652 | void call( |
| 653 | out_type<Array<T>>& out, |