MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / len

Method len

lite/load_and_run/src/helpers/json_loader.cpp:38–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38size_t JsonLoader::Value::len() {
39 if (Type::ARRAY == m_type) {
40 auto t = safe_cast<JsonLoader::ArrayValue>();
41 return t->m_obj.size();
42 } else if (Type::OBJECT == m_type) {
43 auto t = safe_cast<JsonLoader::ObjectValue>();
44 return t->m_obj.size();
45 }
46 return 0;
47}
48
49megdnn::SmallVector<std::unique_ptr<JsonLoader::Value>>& JsonLoader::Value::array() {
50 mgb_assert(Type::ARRAY == m_type);

Callers 2

parse_jsonMethod · 0.80
parse_stringMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected