summaryrefslogtreecommitdiffstats
path: root/low-can-binding
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-12-10 19:02:36 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2020-01-09 16:25:36 +0100
commit528d41049be287fdd273185ab74a8bb2c8d63f5f (patch)
treec283efa9f0896a09539c75b99503e6aa0e4d1b45 /low-can-binding
parent542e3d732ec17e4c49d1059a9262f6535a7f3e62 (diff)
low-can-cb: Little opti
Change-Id: I6f3e84700563fc60e643d770365c98342214bedd Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding')
-rw-r--r--low-can-binding/binding/low-can-cb.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/low-can-binding/binding/low-can-cb.cpp b/low-can-binding/binding/low-can-cb.cpp
index 1ebb392a..0bee7ef4 100644
--- a/low-can-binding/binding/low-can-cb.cpp
+++ b/low-can-binding/binding/low-can-cb.cpp
@@ -394,11 +394,9 @@ static int process_one_subscribe_args(afb_req_t request, bool subscribe, json_ob
// 2 cases : ID(PGN) and event
json_object_object_get_ex(args,"event",&event);
- json_bool test_id = json_object_object_get_ex(args,"id",&id);
- if(!test_id)
- test_id = json_object_object_get_ex(args,"pgn",&id);
+ json_object_object_get_ex(args,"id",&id) || json_object_object_get_ex(args,"pgn",&id);
- if( args == NULL || (id && ((std::string)json_object_get_string(id)).compare("*") == 0))
+ if( args == NULL || (id && ((std::string)json_object_get_string(id)).compare("*") == 0))
{
rc = one_subscribe_unsubscribe_events(request, subscribe, "*", args);
}