Skip to content

Commit

Permalink
Mojo C++ bindings: fix typo and add 'const's.
Browse files Browse the repository at this point in the history
BUG=None

Change-Id: I51437854ca6e0ec565e2c2faf3dcd88db9bcf591
Reviewed-on: https://chromium-review.googlesource.com/667402
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Yuzhu Shen <yzshen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502022}
  • Loading branch information
yzshen authored and Commit Bot committed Sep 14, 2017
1 parent edb4eb8 commit 768ce8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mojo/public/cpp/bindings/lib/multiplex_router.cc
Original file line number Diff line number Diff line change
Expand Up @@ -670,14 +670,14 @@ void MultiplexRouter::OnPipeConnectionError() {
encountered_error_ = true;

// Calling UpdateEndpointStateMayRemove() may remove the corresponding value
// from |endpoints_| and invalidate any interator of |endpoints_|. Therefore,
// from |endpoints_| and invalidate any iterator of |endpoints_|. Therefore,
// copy the endpoint pointers to a vector and iterate over it instead.
std::vector<TrackedScopedRefPtr<InterfaceEndpoint>> endpoint_vector;
endpoint_vector.reserve(endpoints_.size());
for (auto& pair : endpoints_)
for (const auto& pair : endpoints_)
endpoint_vector.push_back(pair.second);

for (auto& endpoint : endpoint_vector) {
for (const auto& endpoint : endpoint_vector) {
if (endpoint->client())
tasks_.push_back(Task::CreateNotifyErrorTask(endpoint.get()));

Expand Down

0 comments on commit 768ce8c

Please sign in to comment.