net: tcp: Change FL() macro to avoid runtime overhead
Instead of strlen() use sizeof() in FL() macro. This way all the checks are done at compile time instead of runtime. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
parent
ff2b827143
commit
31081d8411
1 changed files with 1 additions and 1 deletions
|
@ -328,6 +328,6 @@ struct tcp { /* TCP connection */
|
|||
})
|
||||
|
||||
#define FL(_fl, _op, _mask, _args...) \
|
||||
_flags(_fl, _op, _mask, strlen("" #_args) ? _args : true)
|
||||
_flags(_fl, _op, _mask, sizeof(#_args) > 1 ? _args : true)
|
||||
|
||||
typedef void (*net_tcp_cb_t)(struct tcp *conn, void *user_data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue