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

Function no_whitespace

plugins/plugin_utils/plugin_utils.cpp:154–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154std::string no_whitespace(const std::string& s) {
155 const int sourcesize = (int)s.size();
156
157 int count = 0, i = 0, j = 0;
158 for (i = 0; i < sourcesize; i++)
159 if (!isWhitespace(s[i])) {
160 count++;
161 }
162
163 // create result string of correct size
164 std::string result(count, ' ');
165
166 for (i = 0, j = 0; i < sourcesize; i++)
167 if (!isWhitespace(s[i])) {
168 result[j++] = s[i];
169 }
170
171 return result;
172}
173
174const std::string& tolower(const std::string& s, std::string& dest) {
175 for (std::string::const_iterator i = s.begin(), end = s.end(); i != end; ++i) {

Callers 1

setJobMethod · 0.50

Calls 2

isWhitespaceFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected