MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / string_repeat

Function string_repeat

smallthinker/common/common.cpp:499–512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

497}
498
499std::string string_repeat(const std::string & str, size_t n) {
500 if (n == 0) {
501 return "";
502 }
503
504 std::string result;
505 result.reserve(str.length() * n);
506
507 for (size_t i = 0; i < n; ++i) {
508 result += str;
509 }
510
511 return result;
512}
513
514std::string string_from(bool value) {
515 return value ? "true" : "false";

Callers 1

_build_min_max_intFunction · 0.85

Calls 2

reserveMethod · 0.80
lengthMethod · 0.80

Tested by

no test coverage detected