[libc] Removed public function calls in table.h (#144168)

Removed strcmp, strlen, and memset calls from table.h and replaced them
with internal functions.

---------

Co-authored-by: Sriya Pratipati <sriyap@google.com>
This commit is contained in:
sribee8
2025-06-16 11:03:21 -07:00
committed by GitHub
parent 267b859fc6
commit 4cd3e41bce
3 changed files with 13 additions and 11 deletions

View File

@@ -108,7 +108,9 @@ TEST(LlvmLibcTableTest, Insertion) {
static_cast<void *>(keys[CAP].bytes));
for (size_t i = 0; i <= CAP; ++i) {
ASSERT_EQ(strcmp(table->find(keys[i].bytes)->key, keys[i].bytes), 0);
auto comp = [](char l, char r) -> int { return l - r; };
ASSERT_EQ(
inline_strcmp(table->find(keys[i].bytes)->key, keys[i].bytes, comp), 0);
}
for (size_t i = CAP + 1; i < 256; ++i) {
ASSERT_EQ(table->find(keys[i].bytes), static_cast<ENTRY *>(nullptr));