Use for loop instead of while in GetExistingProcessHost
In RenderProcessHostImpl::GetExistingProcessHost, there is a loop that enumerates all current process hosts. It is implement as a while loop having iter.Advance() at the end. Lets assume a situation when one decides to prohibit some process host from being put to suitable_renderers list. The obvious solution is to check some condition and use continue statement to move to next loop iteration... which results in an infinite loop if iter.Advance() isn't called prior to continue. So it looks more safe to use for loop instead as it executes its 3rd part automatically reducing the human factor influence. This CL is a pure refactoring so there is no behavior change at all. Change-Id: I456cd2ff5348172419e8561d4ebf75d886a02e15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2071016 Commit-Queue: Alex Moshchuk <alexmos@chromium.org> Reviewed-by:Alex Moshchuk <alexmos@chromium.org> Auto-Submit: Denis Bessonov <dbessonov@yandex-team.ru> Cr-Commit-Position: refs/heads/master@{#744396}
Showing
Please register or sign in to comment