aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-09-08 16:43:22 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-09-08 16:43:22 +0900
commit16b18c596468f0ac0eef9c8df2b67786b3fb00ab (patch)
tree785e1e20fef9393b00512dc2c1f9e765c9f1a7f0 /src
parentbc271322e5ad34f00500ca85d4313b9f48f6a449 (diff)
Fix the mistake of generating new layerID
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src')
-rw-r--r--src/wm_layer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wm_layer.cpp b/src/wm_layer.cpp
index 01e8950..cd381c2 100644
--- a/src/wm_layer.cpp
+++ b/src/wm_layer.cpp
@@ -127,8 +127,8 @@ unsigned WMLayer::getNewLayerID(const string& role)
return ret;
}
- auto id_found = std::find(id_list.begin(), id_list.end(), ret);
- if( (ret > this->idEnd()) || (id_found != id_list.cend()) )
+ size_t count = std::count(id_list.begin(), id_list.end(), ret);
+ if( (ret > this->idEnd()) || (count > 1))
{
HMI_NOTICE("id %d is not available then generate new id", ret);
ret = 0; // reset