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

Function trim_trailing_space

common/chat-peg-parser.cpp:11–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9using ordered_json = nlohmann::ordered_json;
10
11static std::string_view trim_trailing_space(std::string_view sv, int max = -1) {
12 int count = 0;
13 while (!sv.empty() && std::isspace(static_cast<unsigned char>(sv.back()))) {
14 if (max != -1 && count >= max) {
15 break;
16 }
17 sv.remove_suffix(1);
18 count++;
19 }
20 return sv;
21}
22
23static std::string_view trim_leading_space(std::string_view sv, int max = -1) {
24 int count = 0;

Callers 2

trimFunction · 0.85
mapMethod · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected