1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00
systemd/coccinelle/isempty.cocci
Lennart Poettering 7b943bb7e3 tree-wide: use strv_isempty() instead of strv_length() == 0
It's a lot faster in many cases, since it's O(1) rather than O(n).
2017-11-29 12:41:08 +01:00

16 lines
164 B
Plaintext

@@
expression s;
@@
- strv_length(s) == 0
+ strv_isempty(s)
@@
expression s;
@@
- strlen(s) == 0
+ isempty(s)
@@
expression s;
@@
- strlen_ptr(s) == 0
+ isempty(s)