From 793af6cb7e6a9cda0b666a704456fca2161e5c9b Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Fri, 22 Dec 2017 10:45:15 +0800 Subject: [PATCH] osd/OSDMap.h: toss osd out if it has no more pending states So we don't push an empty entry into new_state map, which is inefficient. Signed-off-by: xie xingguo --- src/osd/OSDMap.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index fd1f381d90c..bfebdaedbdf 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -480,6 +480,10 @@ public: } new_state[osd] &= ~state; + if (!new_state[osd]) { + // all flags cleared + new_state.erase(osd); + } return true; } -- 2.39.5