[libc-commits] [PATCH] D110222: [libc] Add an implementation of bsearch.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Sep 22 09:10:18 PDT 2021


sivachandra added inline comments.


================
Comment at: libc/test/src/stdlib/CMakeLists.txt:178
+  HDRS
+    DivTest.h
+  DEPENDS
----------------
cheng.w wrote:
> nit by glance: should be bsearch.h?
Thanks for catching. There are no headers for this test so removed it now.


================
Comment at: libc/test/src/stdlib/bsearch_test.cpp:54
+  // Non existent keys
+  for (size_t s = 1; s <= array_size; ++s) {
+    int key = 5;
----------------
michaelrj wrote:
> why is this a loop?
The iteration over the array sizes helps us hit the different corner cases and branches of the implementation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110222/new/

https://reviews.llvm.org/D110222



More information about the libc-commits mailing list