1#include <prim/seadStringUtil.h>
2
3namespace sead::StringUtil
4{
5char16 replace(char16 c, const Buffer<const Char16Pair>& sorted_table)
6{
7 if (sorted_table.size() == 0)
8 return c;
9
10 const s32 idx =
11 sorted_table.binarySearch(item: Char16Pair{.before: c, .after: 0}, cmp: [](const Char16Pair* p1, const Char16Pair* p2) {
12 return p1->before - p2->before;
13 });
14 if (idx < 0)
15 return c;
16
17 return sorted_table[idx].after;
18}
19} // namespace sead::StringUtil
20