Reserve the size for container
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Wed, 13 Jun 2018 00:36:58 +0000 (09:36 +0900)
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Wed, 13 Jun 2018 00:36:58 +0000 (09:36 +0900)
Change-Id: I6b7cbd5e450273695055e11ec4bdc6e6caeba7de
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
src/applist.cpp

index 77f1b2b..365c485 100644 (file)
@@ -25,11 +25,16 @@ using std::vector;
 namespace wm
 {
 
 namespace wm
 {
 
+const static int kReserveClientSize = 100;
+const static int kReserveReqSize    = 10;
+
 AppList::AppList()
 AppList::AppList()
-    : req_list(0),
-      app2client(0),
+    : req_list(),
+      app2client(),
       current_req(1)
 {
       current_req(1)
 {
+    app2client.reserve(kReserveClientSize);
+    req_list.reserve(kReserveReqSize);
 }
 
 AppList::~AppList() {}
 }
 
 AppList::~AppList() {}