Jie Yu created MESOS-4422:
-----------------------------

             Summary: Use adaptor::reverse for reverse iteration in the code 
base.
                 Key: MESOS-4422
                 URL: https://issues.apache.org/jira/browse/MESOS-4422
             Project: Mesos
          Issue Type: Task
            Reporter: Jie Yu


It would be good to be consistent on our looping structure.

Currently, we use foreach for forward iteration and use rbegin/rend for reverse 
iteration. We recently added adaptor::reverse in stout, which allows us to do:

{noformat}
vector<int> input = {....};
foreach (int i, adaptor::reverse(input)) {
  ...
}
{noformat}

We should cleanup our code to consistently use this structure on reverse 
iteration.

{noformat}
jie$ grep -R rbegin src
src/common/protobuf_utils.cpp:  for (auto status = task.statuses().rbegin();
src/slave/containerizer/mesos/containerizer.cpp:  for (auto it = 
isolators.crbegin(); it != isolators.crend(); ++it) {
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to