This is an automated email from the ASF dual-hosted git repository.
mzhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
The following commit(s) were added to refs/heads/master by this push:
new b336ae3 Avoided a double map lookup in the allocator.
b336ae3 is described below
commit b336ae3f09f1020d3d8a6e3ed1bc2b390b6947d5
Author: Meng Zhu <[email protected]>
AuthorDate: Wed Jun 19 15:22:22 2019 -0700
Avoided a double map lookup in the allocator.
Review: https://reviews.apache.org/r/70905
---
src/master/allocator/mesos/hierarchical.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/master/allocator/mesos/hierarchical.cpp
b/src/master/allocator/mesos/hierarchical.cpp
index 0d8b0ca..c9ed094 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -2565,7 +2565,9 @@ bool
HierarchicalAllocatorProcess::isFrameworkTrackedUnderRole(
const Quota2& HierarchicalAllocatorProcess::getQuota(const string& role) const
{
- return roles.contains(role) ? roles.at(role).quota : DEFAULT_QUOTA;
+ auto it = roles.find(role);
+
+ return it == roles.end() ? DEFAULT_QUOTA : it->second.quota;
}