| 164 | } |
| 165 | |
| 166 | absl::StatusOr<std::unique_ptr<ListStorage>> RegisterModernLists( |
| 167 | bool overlap, int len, google::protobuf::Arena* absl_nonnull arena, |
| 168 | Activation& activation) { |
| 169 | auto x_builder = cel::NewListValueBuilder(arena); |
| 170 | auto y_builder = cel::NewListValueBuilder(arena); |
| 171 | |
| 172 | x_builder->Reserve(len + 1); |
| 173 | y_builder->Reserve(len + 1); |
| 174 | |
| 175 | if (overlap) { |
| 176 | CEL_RETURN_IF_ERROR(x_builder->Add(cel::IntValue(2))); |
| 177 | CEL_RETURN_IF_ERROR(y_builder->Add(cel::IntValue(1))); |
| 178 | } |
| 179 | |
| 180 | for (int i = 0; i < len; i++) { |
| 181 | CEL_RETURN_IF_ERROR(x_builder->Add(cel::IntValue(1))); |
| 182 | CEL_RETURN_IF_ERROR(y_builder->Add(cel::IntValue(2))); |
| 183 | } |
| 184 | |
| 185 | auto x = std::move(*x_builder).Build(); |
| 186 | auto y = std::move(*y_builder).Build(); |
| 187 | auto result = std::make_unique<ModernListStorage>(std::move(x), std::move(y)); |
| 188 | activation.InsertValue("x", result->x()); |
| 189 | activation.InsertValue("y", result->y()); |
| 190 | |
| 191 | return result; |
| 192 | } |
| 193 | |
| 194 | absl::StatusOr<std::unique_ptr<ListStorage>> RegisterLists( |
| 195 | bool overlap, int len, bool use_modern, google::protobuf::Arena* absl_nonnull arena, |
no test coverage detected