MCPcopy Create free account
hub / github.com/TelegramMessenger/cocoon / iterate_array

Method iterate_array

runners/helpers/ValidateRequest.cpp:498–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

496 }
497 template <typename F>
498 td::Status iterate_array(F &&run) {
499 if (!is_array()) {
500 return td::Status::Error(ton::ErrorCode::protoviolation, PSTRING() << path << " must be an array");
501 }
502 size_t idx = 0;
503 for (auto &x : *obj) {
504 TRY_STATUS(run(std::make_unique<CtxLevel>(&x, PSTRING() << path << "[" << (idx++) << "]")));
505 }
506 return td::Status::OK();
507 }
508
509 bool is_string() {
510 switch (mode) {

Callers 1

process_arrayMethod · 0.80

Calls 1

runFunction · 0.85

Tested by

no test coverage detected