Replace size() method with empty() when possible.

There is no guaranteed that size() is a constant-time function.
This commit is contained in:
Haojian Wu 2017-03-30 21:44:15 +02:00
parent e4c571fc68
commit d18b34d55f
4 changed files with 5 additions and 6 deletions

View file

@ -67,7 +67,7 @@ DevToolsNetworkInterceptor*
DevToolsNetworkController::GetInterceptor(const std::string& client_id) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!interceptors_.size() || client_id.empty())
if (interceptors_.empty() || client_id.empty())
return nullptr;
DevToolsNetworkInterceptor* interceptor = interceptors_.get(client_id);