MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / trimLeadingWhitespace

Function trimLeadingWhitespace

plugins/plugin_utils/plugin_utils.cpp:468–477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466
467
468void trimLeadingWhitespace(std::string& text) {
469 for (size_t s = 0; s < text.size(); s++) {
470 if (!isWhitespace(text[s])) {
471 if (s) {
472 text.erase(text.begin() + s - 1);
473 }
474 return;
475 }
476 }
477}
478
479std::string trimLeadingWhitespace(const std::string& text) {
480 std::string s = text;

Callers 1

pendingMethod · 0.85

Calls 3

isWhitespaceFunction · 0.70
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected