MCPcopy Create free account
hub / github.com/dgraph-io/dgraph-benchmarks / MarshalToSizedBuffer

Method MarshalToSizedBuffer

bitmap/pb.pb.go:9224–9262  ·  view source on GitHub ↗
(dAtA []byte)

Source from the content-addressed store, hash-verified

9222}
9223
9224func (m *SchemaRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
9225 i := len(dAtA)
9226 _ = i
9227 var l int
9228 _ = l
9229 if len(m.Types) > 0 {
9230 for iNdEx := len(m.Types) - 1; iNdEx >= 0; iNdEx-- {
9231 i -= len(m.Types[iNdEx])
9232 copy(dAtA[i:], m.Types[iNdEx])
9233 i = encodeVarintPb(dAtA, i, uint64(len(m.Types[iNdEx])))
9234 i--
9235 dAtA[i] = 0x22
9236 }
9237 }
9238 if len(m.Fields) > 0 {
9239 for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- {
9240 i -= len(m.Fields[iNdEx])
9241 copy(dAtA[i:], m.Fields[iNdEx])
9242 i = encodeVarintPb(dAtA, i, uint64(len(m.Fields[iNdEx])))
9243 i--
9244 dAtA[i] = 0x1a
9245 }
9246 }
9247 if len(m.Predicates) > 0 {
9248 for iNdEx := len(m.Predicates) - 1; iNdEx >= 0; iNdEx-- {
9249 i -= len(m.Predicates[iNdEx])
9250 copy(dAtA[i:], m.Predicates[iNdEx])
9251 i = encodeVarintPb(dAtA, i, uint64(len(m.Predicates[iNdEx])))
9252 i--
9253 dAtA[i] = 0x12
9254 }
9255 }
9256 if m.GroupId != 0 {
9257 i = encodeVarintPb(dAtA, i, uint64(m.GroupId))
9258 i--
9259 dAtA[i] = 0x8
9260 }
9261 return len(dAtA) - i, nil
9262}
9263
9264func (m *SchemaNode) Marshal() (dAtA []byte, err error) {
9265 size := m.Size()

Callers 3

XXX_MarshalMethod · 0.95
MarshalMethod · 0.95
MarshalToMethod · 0.95

Calls 1

encodeVarintPbFunction · 0.85

Tested by

no test coverage detected