MCPcopy Create free account
hub / github.com/cutechess/cutechess / joinTokens

Function joinTokens

projects/lib/src/uciengine.cpp:72–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72QStringView joinTokens(const QVarLengthArray<QStringView>& tokens)
73{
74 Q_ASSERT(!tokens.isEmpty());
75
76 // All tokens are views into the same underlying string, so the span
77 // from the first token to the end of the last token can be recovered
78 // with pointer arithmetic. This preserves any whitespace between them.
79 const QStringView& first = tokens.front();
80 const QStringView& last = tokens.back();
81
82 return QStringView(first.data(), (last.data() + last.size()) - first.data());
83}
84
85} // namespace
86

Callers 1

parseOptionMethod · 0.85

Calls 3

isEmptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected