From f6362cd19c1f4453ba09f91c4598aec35b8ae940 Mon Sep 17 00:00:00 2001 From: Jin Huang Date: Tue, 12 Aug 2025 21:35:16 +0000 Subject: [PATCH 1/2] [libc] Refactor libc code to imporove readability. --- libc/src/wchar/wcsncmp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/src/wchar/wcsncmp.cpp b/libc/src/wchar/wcsncmp.cpp index f2e052b3c9fe3..2b05552782bb6 100644 --- a/libc/src/wchar/wcsncmp.cpp +++ b/libc/src/wchar/wcsncmp.cpp @@ -30,8 +30,8 @@ LLVM_LIBC_FUNCTION(int, wcsncmp, if (!comp(lc, '\0') || comp(lc, *right)) break; } - return comp(*reinterpret_cast(left), - *reinterpret_cast(right)); + return comp(*left, + *right); } } // namespace LIBC_NAMESPACE_DECL From 9c2a1c50093ba12a6bd01639b6c5cc8481ec8e54 Mon Sep 17 00:00:00 2001 From: Jin Huang Date: Tue, 12 Aug 2025 22:22:20 +0000 Subject: [PATCH 2/2] improve the readability --- libc/src/wchar/wcsncmp.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libc/src/wchar/wcsncmp.cpp b/libc/src/wchar/wcsncmp.cpp index 2b05552782bb6..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(*left, - *right); + return comp(*left, *right); } } // namespace LIBC_NAMESPACE_DECL