[PATCH 12/18] lib: bitmap: Simplify bitmap_parselist

2014-07-03 Thread Rasmus Villemoes
We want len to be the index of the first '\n', or the length of the string if there is no newline. This is a good example of the usefulness of strchrnul(). Use that instead, thus eliminating a branch and a call to strlen(). Signed-off-by: Rasmus Villemoes --- lib/bitmap.c | 9 ++--- 1 file

[PATCH 12/18] lib: bitmap: Simplify bitmap_parselist

2014-07-03 Thread Rasmus Villemoes
We want len to be the index of the first '\n', or the length of the string if there is no newline. This is a good example of the usefulness of strchrnul(). Use that instead, thus eliminating a branch and a call to strlen(). Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk ---