[libc-commits] [PATCH] D106901: [libc] add strncmp to strings

Cheng Wang via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Jul 28 03:24:48 PDT 2021


cheng.w added inline comments.


================
Comment at: libc/src/string/strncmp.cpp:19
+                   (const char *left, const char *right, size_t n)) {
+  if (n < 1) {
+    return 0;
----------------
sivachandra wrote:
> Nitty comment: Why can it not be just `n == 0`?
nit: We could omit the braces since the body of `if` is simple.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106901



More information about the libc-commits mailing list