use reference to avoid copying
This commit is contained in:
parent
95dd0f771f
commit
8319ae3b5d
@ -11,7 +11,7 @@ public:
|
||||
this->protocol = protocol;
|
||||
}
|
||||
|
||||
virtual void fromJson(JsonObjectConst rcSwitch, RCSwitch& rcDevice) {
|
||||
virtual void fromJson(JsonObjectConst& rcSwitch, RCSwitch& rcDevice) {
|
||||
unsigned int protocol = rcSwitch["protocol"];
|
||||
rcDevice.setProtocol(protocol);
|
||||
rcDevice.send(rcSwitch["value"]);
|
||||
|
||||
@ -11,7 +11,7 @@ public:
|
||||
Protocol_1() : Protocol(1) {
|
||||
}
|
||||
|
||||
void fromJson(JsonObjectConst rcSwitch, RCSwitch& rcDevice) override {
|
||||
void fromJson(JsonObjectConst& rcSwitch, RCSwitch& rcDevice) override {
|
||||
unsigned int protocol = rcSwitch["protocol"];
|
||||
rcDevice.setProtocol(protocol);
|
||||
char* group = rcSwitch["group"];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user