MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / prev_utf8_char_pos

Function prev_utf8_char_pos

common/console.cpp:432–439  ·  view source on GitHub ↗

Helper function to remove the last UTF-8 character from a string

Source from the content-addressed store, hash-verified

430
431 // Helper function to remove the last UTF-8 character from a string
432 static size_t prev_utf8_char_pos(const std::string & line, size_t pos) {
433 if (pos == 0) return 0;
434 pos--;
435 while (pos > 0 && (line[pos] & 0xC0) == 0x80) {
436 pos--;
437 }
438 return pos;
439 }
440
441 static size_t next_utf8_char_pos(const std::string & line, size_t pos) {
442 if (pos >= line.length()) return line.length();

Callers 2

move_word_leftFunction · 0.85
readline_advancedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected