Przeglądaj źródła

Remove useless reflection into marshaling.

Fedorenko Dmitriy 11 lat temu
rodzic
commit
392edd15c8
1 zmienionych plików z 1 dodań i 2 usunięć
  1. 1 2
      marshal.go

+ 1 - 2
marshal.go

@@ -703,8 +703,7 @@ func unmarshalDecimal(info *TypeInfo, data []byte, value interface{}) error {
 	case *inf.Dec:
 		scale := decInt(data[0:4])
 		unscaled := decBigInt2C(data[4:], nil)
-		newValue := reflect.ValueOf(inf.NewDecBig(unscaled, inf.Scale(scale)))
-		reflect.ValueOf(value).Elem().Set(newValue.Elem())
+		*v = *inf.NewDecBig(unscaled, inf.Scale(scale))
 		return nil
 	}
 	return unmarshalErrorf("can not unmarshal %s into %T", info, value)