| 53 | namespace 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 | } |
no test coverage detected