| 145 | } |
| 146 | |
| 147 | const TResolvedHost* Resolve(const TResolveTask& rt) override { |
| 148 | //1. search in local thread cache |
| 149 | { |
| 150 | TCache::const_iterator it = C_.find(rt.Info); |
| 151 | |
| 152 | if (it != C_.end()) { |
| 153 | return it->second; |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | const TResolvedHost* res = S_->Resolve(rt); |
| 158 | |
| 159 | C_[TResolveInfo(res->Host, rt.Info.Port)] = res; |
| 160 | |
| 161 | return res; |
| 162 | } |
| 163 | |
| 164 | private: |
| 165 | typedef THashMap<TResolveInfo, const TResolvedHost*, THashResolveInfo, TCompareResolveInfo> TCache; |
no test coverage detected