Simplify serialization code and avoid extra copy

This commit is contained in:
Kovid Goyal
2022-08-26 17:07:53 +05:30
parent 0cda5d43a6
commit a960937095
4 changed files with 31 additions and 47 deletions

View File

@@ -11,14 +11,8 @@ type RemoteControlCmd struct {
Password string `json:"password,omitempty"`
Async string `json:"async,omitempty"`
CancelAsync bool `json:"cancel_async,omitempty"`
single_sent bool
}
func (self *RemoteControlCmd) SingleSent() bool { return self.single_sent }
func (self *RemoteControlCmd) SetSingleSent() { self.single_sent = true }
func (self *RemoteControlCmd) ResetSingleSent() { self.single_sent = false }
type EncryptedRemoteControlCmd struct {
Version [3]int `json:"version"`
IV string `json:"iv"`