MCPcopy Create free account
hub / github.com/apache/mesos / ancestors

Function ancestors

src/common/roles.cpp:58–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56
57
58vector<string> ancestors(const string& role)
59{
60 vector<string> result;
61
62 for (int i = role.size() - 1; i >= 0; --i) {
63 if (role[i] == '/') {
64 result.push_back(role.substr(0, i));
65 }
66 }
67
68 return result;
69}
70
71
72// TODO(haosdent): Pull this out into `stout` and make it satisfy all

Callers 2

TEST_FFunction · 0.85
foreachFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.68