[libc-commits] [libc] 91de0a2 - [libc] Refactor libc code to improve readability. (#153308)

via libc-commits libc-commits at lists.llvm.org
Tue Aug 12 21:41:25 PDT 2025


Author: Jin Huang
Date: 2025-08-12T21:41:21-07:00
New Revision: 91de0a2c439ce3d77639a6b8ce8eda5089307392

URL: https://github.com/llvm/llvm-project/commit/91de0a2c439ce3d77639a6b8ce8eda5089307392
DIFF: https://github.com/llvm/llvm-project/commit/91de0a2c439ce3d77639a6b8ce8eda5089307392.diff

LOG: [libc] Refactor libc code to improve readability. (#153308)

The PR is going to improve the readability for the files under
`llvm-project/libc/src/wchar` directory.

---------

Co-authored-by: Jin Huang <jingold at google.com>

Added: 
    

Modified: 
    libc/src/wchar/wcsncmp.cpp

Removed: 
    


################################################################################
diff  --git a/libc/src/wchar/wcsncmp.cpp b/libc/src/wchar/wcsncmp.cpp
index f2e052b3c9fe3..baca12bffb188 100644
--- a/libc/src/wchar/wcsncmp.cpp
+++ b/libc/src/wchar/wcsncmp.cpp
@@ -30,8 +30,7 @@ LLVM_LIBC_FUNCTION(int, wcsncmp,
     if (!comp(lc, '\0') || comp(lc, *right))
       break;
   }
-  return comp(*reinterpret_cast<const wchar_t *>(left),
-              *reinterpret_cast<const wchar_t *>(right));
+  return comp(*left, *right);
 }
 
 } // namespace LIBC_NAMESPACE_DECL


        


More information about the libc-commits mailing list