app: preallocate layouts storage
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>
Fri, 28 Jul 2017 10:43:09 +0000 (12:43 +0200)
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>
Tue, 8 Aug 2017 15:24:00 +0000 (17:24 +0200)
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
src/app.cpp

index 3f62575..e04b89b 100644 (file)
@@ -65,6 +65,7 @@ struct result<layouts_type> load_layout(char const *filename) {
    i >> jlayouts;
 
    auto layouts = layouts_type();
+   layouts.reserve(jlayouts.size());
    std::transform(std::cbegin(jlayouts), std::cend(jlayouts),
                   std::back_inserter(layouts), layout_from_json);