mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2024-12-26 21:24:22 +00:00
internal/impl: remove unused ExtensionField.SetLazy method
This cleanup was done in June 2020 by Dan Scales, but never upstreamed to the open source Go Protobuf repository. Change-Id: I175d9588b5bb536fa276133f8fe6073278e6d3b0 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/605895 Reviewed-by: Christian Höppner <hoeppi@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
b36f8e04bd
commit
94ecbc2616
@ -67,7 +67,6 @@ type lazyExtensionValue struct {
|
||||
xi *extensionFieldInfo
|
||||
value protoreflect.Value
|
||||
b []byte
|
||||
fn func() protoreflect.Value
|
||||
}
|
||||
|
||||
type ExtensionField struct {
|
||||
@ -158,10 +157,9 @@ func (f *ExtensionField) lazyInit() {
|
||||
}
|
||||
f.lazy.value = val
|
||||
} else {
|
||||
f.lazy.value = f.lazy.fn()
|
||||
panic("No support for lazy fns for ExtensionField")
|
||||
}
|
||||
f.lazy.xi = nil
|
||||
f.lazy.fn = nil
|
||||
f.lazy.b = nil
|
||||
atomic.StoreUint32(&f.lazy.atomicOnce, 1)
|
||||
}
|
||||
@ -174,13 +172,6 @@ func (f *ExtensionField) Set(t protoreflect.ExtensionType, v protoreflect.Value)
|
||||
f.lazy = nil
|
||||
}
|
||||
|
||||
// SetLazy sets the type and a value that is to be lazily evaluated upon first use.
|
||||
// This must not be called concurrently.
|
||||
func (f *ExtensionField) SetLazy(t protoreflect.ExtensionType, fn func() protoreflect.Value) {
|
||||
f.typ = t
|
||||
f.lazy = &lazyExtensionValue{fn: fn}
|
||||
}
|
||||
|
||||
// Value returns the value of the extension field.
|
||||
// This may be called concurrently.
|
||||
func (f *ExtensionField) Value() protoreflect.Value {
|
||||
|
Loading…
Reference in New Issue
Block a user