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

Function FormatRange

library/cpp/yt/string/format-inl.h:200–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198
199template <class TRange, class TFormatter>
200void FormatRange(TStringBuilderBase* builder, const TRange& range, const TFormatter& formatter, size_t limit = std::numeric_limits<size_t>::max())
201{
202 builder->AppendChar('[');
203 size_t index = 0;
204 for (const auto& item : range) {
205 if (index > 0) {
206 builder->AppendString(DefaultJoinToStringDelimiter);
207 }
208 if (index == limit) {
209 builder->AppendString(DefaultRangeEllipsisFormat);
210 break;
211 }
212 formatter(builder, item);
213 ++index;
214 }
215 builder->AppendChar(']');
216}
217
218////////////////////////////////////////////////////////////////////////////////
219

Callers 1

FormatValueFunction · 0.85

Calls 4

AppendCharMethod · 0.80
maxFunction · 0.50
formatterFunction · 0.50
AppendStringMethod · 0.45

Tested by

no test coverage detected