Skip to content

Commit

Permalink
unicode : pass as cpts as const ref
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Mar 11, 2024
1 parent af0621e commit 3680bc2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion unicode.cpp
Expand Up @@ -1623,7 +1623,7 @@ std::string unicode_cpt_to_utf8(uint32_t cp) {
return result;
}

std::vector<uint32_t> unicode_cpts_normalize_nfd(std::vector<uint32_t> cpts) {
std::vector<uint32_t> unicode_cpts_normalize_nfd(const std::vector<uint32_t> & cpts) {
std::vector<uint32_t> result;
result.reserve(cpts.size());
for (size_t i = 0; i < cpts.size(); ++i) {
Expand Down
2 changes: 1 addition & 1 deletion unicode.h
Expand Up @@ -16,7 +16,7 @@
std::string unicode_cpt_to_utf8(uint32_t cp);
std::vector<uint32_t> unicode_cpts_from_utf8(const std::string & utf8);

std::vector<uint32_t> unicode_cpts_normalize_nfd(std::vector<uint32_t> cpts);
std::vector<uint32_t> unicode_cpts_normalize_nfd(const std::vector<uint32_t> & cpts);

int unicode_cpt_type(uint32_t cp);
int unicode_cpt_type(const std::string & utf8);
Expand Down

0 comments on commit 3680bc2

Please sign in to comment.