MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / ToCord

Method ToCord

common/internal/byte_string.cc:540–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

538} // namespace
539
540absl::Cord ByteString::ToCord() const& {
541 switch (GetKind()) {
542 case ByteStringKind::kSmall:
543 return absl::Cord(GetSmall());
544 case ByteStringKind::kMedium: {
545 const auto* refcount = GetMediumReferenceCount();
546 if (refcount != nullptr) {
547 StrongRef(*refcount);
548 return absl::MakeCordFromExternal(GetMedium(),
549 ReferenceCountReleaser{refcount});
550 }
551 return absl::Cord(GetMedium());
552 }
553 case ByteStringKind::kLarge:
554 return GetLarge();
555 }
556}
557
558absl::Cord ByteString::ToCord() && {
559 switch (GetKind()) {

Callers 8

ConcatMethod · 0.80
TEST_PFunction · 0.80
NativeCordFunction · 0.80
ToCordFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
NativeCordFunction · 0.80
ToCordFunction · 0.80

Calls 5

GetKindFunction · 0.85
GetSmallFunction · 0.85
StrongRefFunction · 0.85
GetMediumFunction · 0.85
SetSmallEmptyFunction · 0.85

Tested by 3

TEST_PFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64