Removed Reset and PropReset which are not required.

This commit is contained in:
scruzin 2019-01-12 15:29:58 +10:30
parent 1fe1849393
commit f7de9526c8
2 changed files with 1 additions and 20 deletions

View File

@ -391,16 +391,6 @@ func PropDecode(prop *Property, data []byte, decodeName bool) (int, error) {
return sz - len(data), nil
}
func PropReset(prop *Property) {
if prop.dtype == TypeObject || prop.dtype == typeEcmaArray ||
prop.dtype == typeStrictArray {
Reset(&prop.obj)
} else {
prop.str = ""
}
prop.dtype = typeInvalid
}
// Encode serializes an Object into its AMF representation.
func Encode(obj *Object, dst []byte) ([]byte, error) {
if len(dst) < 5 {
@ -505,10 +495,3 @@ func GetProp(obj *Object, name string, idx int32) *Property {
}
return &Property{}
}
func Reset(obj *Object) {
for i := range obj.Props {
PropReset(&obj.Props[i])
}
*obj = Object{}
}

View File

@ -702,7 +702,7 @@ func handleInvoke(s *Session, body []byte) error {
}
if methodInvoked == "" {
s.log(WarnLevel, pkg+"received result without matching request", "id", txn)
goto leave
return nil
}
s.log(DebugLevel, pkg+"received result for "+methodInvoked)
@ -806,8 +806,6 @@ func handleInvoke(s *Session, body []byte) error {
default:
s.log(FatalLevel, pkg+"unknown method "+meth)
}
leave:
amf.Reset(&obj)
return nil
}