This commit is contained in:
crusader 2017-11-27 19:33:16 +09:00
parent fe763851e8
commit cd79287e2d

View File

@ -12,7 +12,6 @@ type Attributes interface {
Get(key string) (value interface{}) Get(key string) (value interface{})
Remove(key string) Remove(key string)
Contains(key string) (exist bool) Contains(key string) (exist bool)
Destroy()
} }
func NewAttributes(parent Attributes) Attributes { func NewAttributes(parent Attributes) Attributes {
@ -36,9 +35,6 @@ func (am *attributes) initialize() {
am.Parent.initialize() am.Parent.initialize()
} }
if nil == am.values {
am.Destroy()
}
am.values = make(map[string]interface{}) am.values = make(map[string]interface{})
} }
@ -101,16 +97,6 @@ func (am *attributes) Contains(key string) (exist bool) {
return am.Parent.Contains(key) return am.Parent.Contains(key)
} }
func (am *attributes) Destroy() {
if nil != am.values {
am.values = nil
}
if nil != am.Parent {
am.Parent.Destroy()
}
}
func (am *attributes) checkInitialized() { func (am *attributes) checkInitialized() {
if nil == am.values { if nil == am.values {
panic("Attribute Manager: must be initialized") panic("Attribute Manager: must be initialized")