зеркало из https://github.com/electron/electron.git
chore: change some for loops to range-based (#37857)
This commit is contained in:
Родитель
82442239bc
Коммит
e929b2140d
|
@ -115,10 +115,10 @@ v8::Local<v8::Value> ServiceWorkerContext::GetAllRunningWorkerInfo(
|
|||
gin::DataObjectBuilder builder(isolate);
|
||||
const base::flat_map<int64_t, content::ServiceWorkerRunningInfo>& info_map =
|
||||
service_worker_context_->GetRunningServiceWorkerInfos();
|
||||
for (auto iter = info_map.begin(); iter != info_map.end(); ++iter) {
|
||||
for (const auto& iter : info_map) {
|
||||
builder.Set(
|
||||
std::to_string(iter->first),
|
||||
ServiceWorkerRunningInfoToDict(isolate, std::move(iter->second)));
|
||||
std::to_string(iter.first),
|
||||
ServiceWorkerRunningInfoToDict(isolate, std::move(iter.second)));
|
||||
}
|
||||
return builder.Build();
|
||||
}
|
||||
|
|
|
@ -240,8 +240,8 @@ std::vector<blink::MessagePortChannel> MessagePort::DisentanglePorts(
|
|||
// Passed-in ports passed validity checks, so we can disentangle them.
|
||||
std::vector<blink::MessagePortChannel> channels;
|
||||
channels.reserve(ports.size());
|
||||
for (unsigned i = 0; i < ports.size(); ++i)
|
||||
channels.push_back(ports[i]->Disentangle());
|
||||
for (auto port : ports)
|
||||
channels.push_back(port->Disentangle());
|
||||
return channels;
|
||||
}
|
||||
|
||||
|
|
|
@ -578,8 +578,7 @@ bool Converter<scoped_refptr<network::ResourceRequestBody>>::FromV8(
|
|||
return false;
|
||||
base::Value::List& list = list_value.GetList();
|
||||
*out = base::MakeRefCounted<network::ResourceRequestBody>();
|
||||
for (size_t i = 0; i < list.size(); ++i) {
|
||||
base::Value& dict_value = list[i];
|
||||
for (base::Value& dict_value : list) {
|
||||
if (!dict_value.is_dict())
|
||||
return false;
|
||||
base::Value::Dict& dict = dict_value.GetDict();
|
||||
|
|
Загрузка…
Ссылка в новой задаче