From 924df5ddaf2f79cb4e7597661acc3840f9844a59 Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Tue, 12 Jun 2018 08:47:16 +0900 Subject: Reserve default size for list Change-Id: I2c3a340ca73665382a8ac816c11391d708e9bfbd Signed-off-by: Kazumasa Mitsunari --- src/applist.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/applist.cpp b/src/applist.cpp index 13e677c..06c1d86 100644 --- a/src/applist.cpp +++ b/src/applist.cpp @@ -22,14 +22,17 @@ using std::shared_ptr; using std::string; using std::vector; +const static int kReserveReqSize = 10; +const static int kReserveCLSize = 100; + namespace wm { AppList::AppList() - : req_list(0), - app2client(0), - current_req(1) + : current_req(1) { + req_list.reserve(kReserveReqSize); + app2client.reserve(kReserveCLSize); } void AppList::addClient(const string &appid, const string &role) -- cgit 1.2.3-korg