MCPcopy Create free account
hub / github.com/catboost/catboost / JoinRange

Function JoinRange

util/string/join.h:115–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113namespace NPrivate {
114 template <typename TCharType, typename TIter>
115 inline TBasicString<TCharType> JoinRange(TBasicStringBuf<TCharType> delim, const TIter beg, const TIter end) {
116 TBasicString<TCharType> out;
117 if (beg != end) {
118 size_t total = ::NPrivate::GetLength(*beg);
119 for (TIter pos = beg; ++pos != end;) {
120 total += delim.length() + ::NPrivate::GetLength(*pos);
121 }
122 if (total > 0) {
123 out.reserve(total);
124 }
125
126 AppendToString(out, *beg);
127 for (TIter pos = beg; ++pos != end;) {
128 AppendJoinNoReserve(out, delim, *pos);
129 }
130 }
131
132 return out;
133 }
134
135} // namespace NPrivate
136

Callers 3

JoinSeqFunction · 0.70
Y_UNIT_TESTFunction · 0.70
httpreqdata.cppFile · 0.50

Calls 5

AppendJoinNoReserveFunction · 0.85
GetLengthFunction · 0.70
AppendToStringFunction · 0.70
lengthMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected