mirror_zfs/lib
rilysh e8f4592a19 Avoid computing strlen() inside loops
Compiling with -O0 (no proper optimizations), strlen() call
in loops for comparing the size, isn't being called/initialized
before the actual loop gets started, which causes n-numbers of
strlen() calls (as long as the string is). Keeping the length
before entering in the loop is a good idea.

On some places, even with -O2, both GCC and Clang can't
recognize this pattern, which seem to happen in an array
of char pointer.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: rilysh <nightquick@proton.me>
Closes #16584
2024-11-05 15:43:52 -08:00
..
libavl cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libefi Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN. 2024-05-13 10:27:38 -05:00
libicp Add generic implementation handling and SHA2 impl 2023-03-02 13:52:21 -08:00
libnvpair nvpair: Constify string functions 2023-03-14 15:25:50 -07:00
libshare Fix handling of DNS names with '-' in them for sharenfs 2024-11-05 15:43:52 -08:00
libspl Add SIMD metadata in /proc on Linux 2024-11-05 15:43:52 -08:00
libtpool Add <limits.h> header 2022-11-28 13:24:17 -08:00
libunicode cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libuutil GCC: Fixes for gcc 14 on Fedora 40 2024-04-29 13:50:05 -07:00
libzfs Avoid computing strlen() inside loops 2024-11-05 15:43:52 -08:00
libzfs_core Fix occasional rsend test crashes 2023-09-22 16:13:20 -07:00
libzfsbootenv nvpair: Constify string functions 2023-03-14 15:25:50 -07:00
libzpool Add SIMD metadata in /proc on Linux 2024-11-05 15:43:52 -08:00
libzstd cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libzutil Reduce and handle EAGAIN errors on AIO label reads 2024-11-05 15:43:52 -08:00
Makefile.am autoconf: use include directives instead of recursing down lib 2022-05-10 10:18:11 -07:00