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

Function ChooseBestCompressionScheme

library/cpp/http/io/compression.h:55–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53namespace NHttp {
54 template <typename F>
55 TString ChooseBestCompressionScheme(F accepted, TArrayRef<const TStringBuf> available) {
56 if (available.empty()) {
57 return "identity";
58 }
59
60 if (accepted("*")) {
61 return TString(available[0]);
62 }
63
64 for (const auto& coding : available) {
65 TString s(coding);
66 if (accepted(s)) {
67 return s;
68 }
69 }
70
71 return "identity";
72 }
73}

Callers 2

Y_UNIT_TESTFunction · 0.85
BestCompressionSchemeMethod · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected