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

Function dataRefFromBytesView

valdi_core/src/valdi_core/cpp/Utils/DjinniUtils.cpp:50–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50djinni::DataRef dataRefFromBytesView(const Valdi::BytesView& bytesView) {
51 auto existingDataRef = castOrNull<DataRefSimpleRef>(bytesView.getSource());
52 if (existingDataRef != nullptr && existingDataRef->getDataRef().buf() == bytesView.data() &&
53 existingDataRef->getDataRef().len() == bytesView.size()) {
54 return existingDataRef->getDataRef();
55 }
56
57 return djinni::DataRef(std::make_shared<DataRefValdi>(bytesView));
58}
59} // namespace Valdi

Callers

nothing calls this directly

Calls 5

DataRefClass · 0.85
bufMethod · 0.45
dataMethod · 0.45
lenMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected