MCPcopy Create free account
hub / github.com/apache/fory / clearFieldValue

Function clearFieldValue

go/fory/struct.go:872–880  ·  view source on GitHub ↗
(kind FieldKind, fieldPtr unsafe.Pointer, opt optionalInfo)

Source from the content-addressed store, hash-verified

870}
871
872func clearFieldValue(kind FieldKind, fieldPtr unsafe.Pointer, opt optionalInfo) {
873 switch kind {
874 case FieldKindPointer:
875 *(*unsafe.Pointer)(fieldPtr) = nil
876 case FieldKindOptional:
877 *(*bool)(unsafe.Add(fieldPtr, opt.hasOffset)) = false
878 default:
879 }
880}
881
882func writeOptionFast(ctx *WriteContext, field *FieldInfo, optPtr unsafe.Pointer) bool {
883 buf := ctx.Buffer()

Callers 2

readFieldsInOrderMethod · 0.85

Calls 1

AddMethod · 0.45

Tested by

no test coverage detected