MCPcopy Create free account
hub / github.com/Snapchat/Valdi / toPackedRepeated

Function toPackedRepeated

valdi_protobuf/src/valdi_protobuf/Field.cpp:744–756  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

742}
743
744static RepeatedField* toPackedRepeated(Field* field, RepeatedParser parser) {
745 if (field->getInternalType() == Field::InternalType::Raw) {
746 auto raw = field->getRaw();
747 return parsePackedRepeated(field, raw.data, raw.length, parser);
748 } else {
749 auto* typedArray = field->getTypedArray();
750 if (typedArray != nullptr) {
751 return parsePackedRepeated(field, typedArray->getBuffer().data(), typedArray->getBuffer().size(), parser);
752 }
753 }
754
755 return field->toRepeated();
756}
757
758static void parseVarintRepeated(RepeatedField* repeated, const Byte* data, size_t length) {
759 google::protobuf::io::CodedInputStream inputStream(data, static_cast<int>(length));

Callers 3

toVarintRepeatedMethod · 0.85
toFixed32RepeatedMethod · 0.85
toFixed64RepeatedMethod · 0.85

Calls 7

parsePackedRepeatedFunction · 0.85
getInternalTypeMethod · 0.80
getRawMethod · 0.80
toRepeatedMethod · 0.80
getTypedArrayMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected