diff --git a/Applications/TextMate/src/RMateServer.cc b/Applications/TextMate/src/RMateServer.cc index 40ceb225..2a6d0ac1 100644 --- a/Applications/TextMate/src/RMateServer.cc +++ b/Applications/TextMate/src/RMateServer.cc @@ -468,7 +468,7 @@ struct socket_observer_t } else { - records.push_back(record_t(str)); + records.emplace_back(str); state = arguments; } D(DBF_RMateServer, bug("Got command ā€˜%s’\n", str.c_str());); diff --git a/Frameworks/OakAppKit/src/OakEncodingPopUpButton.mm b/Frameworks/OakAppKit/src/OakEncodingPopUpButton.mm index e16a9dc7..bd290025 100644 --- a/Frameworks/OakAppKit/src/OakEncodingPopUpButton.mm +++ b/Frameworks/OakAppKit/src/OakEncodingPopUpButton.mm @@ -37,7 +37,7 @@ namespace // encoding_list { std::string name, code; if(plist::get_key_path(*item, "name", name) && plist::get_key_path(*item, "code", code)) - res.push_back(charset_t(name, code)); + res.emplace_back(name, code); } } diff --git a/Frameworks/OakFileBrowser/src/io/FSDirectoryDataSource.mm b/Frameworks/OakFileBrowser/src/io/FSDirectoryDataSource.mm index e3b74d5c..f2da66bb 100644 --- a/Frameworks/OakFileBrowser/src/io/FSDirectoryDataSource.mm +++ b/Frameworks/OakFileBrowser/src/io/FSDirectoryDataSource.mm @@ -205,7 +205,7 @@ private: std::string const path = path::join(dir, entry->d_name); if(!includeHidden && (globs.exclude(path, entry->d_type == DT_DIR ? path::kPathItemDirectory : path::kPathItemFile) || (path::info(path) & path::flag::hidden))) continue; - newItems.push_back(fs_item_t(buf.st_dev, entry, path)); + newItems.emplace_back(buf.st_dev, entry, path); } dispatch_async(dispatch_get_main_queue(), ^{ diff --git a/Frameworks/bundles/src/index.cc b/Frameworks/bundles/src/index.cc index fabd2c67..ebd789e2 100644 --- a/Frameworks/bundles/src/index.cc +++ b/Frameworks/bundles/src/index.cc @@ -127,7 +127,7 @@ namespace bundles std::string name; oak::uuid_t uuid; if(plist::get_key_path(*it, kFieldName, name) && plist::get_key_path(*it, kFieldUUID, uuid)) - _required_bundles.push_back(required_bundle_t(name, uuid)); + _required_bundles.emplace_back(name, uuid); } } diff --git a/Frameworks/editor/src/editor.cc b/Frameworks/editor/src/editor.cc index a7e0223a..64cd4475 100644 --- a/Frameworks/editor/src/editor.cc +++ b/Frameworks/editor/src/editor.cc @@ -136,14 +136,14 @@ namespace ng { if(range->empty()) { - _marks.push_back(mark_t(range->first, mark_t::kUnpairedMark)); - _marks.push_back(mark_t(range->first, mark_t::kEndMark)); + _marks.emplace_back(range->first, mark_t::kUnpairedMark); + _marks.emplace_back(range->first, mark_t::kEndMark); } else { size_t userInfo = (range->columnar ? kColumnar : 0) | (range->last < range->first ? kReversed : 0); - _marks.push_back(mark_t(range->min(), mark_t::kBeginMark, userInfo)); - _marks.push_back(mark_t(range->max(), mark_t::kEndMark, userInfo)); + _marks.emplace_back(range->min(), mark_t::kBeginMark, userInfo); + _marks.emplace_back(range->max(), mark_t::kEndMark, userInfo); } } diff --git a/Frameworks/layout/src/paragraph.cc b/Frameworks/layout/src/paragraph.cc index eb95193b..537f0b2b 100644 --- a/Frameworks/layout/src/paragraph.cc +++ b/Frameworks/layout/src/paragraph.cc @@ -399,7 +399,7 @@ namespace ng auto node = _nodes.begin() + i; if(node->type() == kNodeTypeSoftBreak) { - softlines.push_back(softline_t(firstOffset, x, y, metrics.baseline(ascent), metrics.line_height(ascent, descent, leading), first, i + (softBreaksOnNewline ? 0 : 1))); + softlines.emplace_back(firstOffset, x, y, metrics.baseline(ascent), metrics.line_height(ascent, descent, leading), first, i + (softBreaksOnNewline ? 0 : 1)); firstOffset = offset; x = (softBreaksOnNewline ? 0 : node->width()); y += metrics.line_height(ascent, descent, leading); @@ -421,7 +421,7 @@ namespace ng offset += node->length(); } - softlines.push_back(softline_t(firstOffset, x, y, metrics.baseline(ascent), metrics.line_height(ascent, descent, leading), first, _nodes.size())); + softlines.emplace_back(firstOffset, x, y, metrics.baseline(ascent), metrics.line_height(ascent, descent, leading), first, _nodes.size()); return softlines; } diff --git a/Frameworks/plist/src/plist.cc b/Frameworks/plist/src/plist.cc index 18f6ce98..d4e666b9 100644 --- a/Frameworks/plist/src/plist.cc +++ b/Frameworks/plist/src/plist.cc @@ -47,7 +47,7 @@ namespace plist std::vector& ref = boost::get< std::vector >(res = std::vector()); for(CFIndex i = 0; i < CFArrayGetCount(array); ++i) { - ref.push_back(any_t()); + ref.emplace_back(); convert_any(CFArrayGetValueAtIndex(array, i), ref.back()); } } diff --git a/Frameworks/regexp/src/glob.cc b/Frameworks/regexp/src/glob.cc index 1e5bcb1d..73027035 100644 --- a/Frameworks/regexp/src/glob.cc +++ b/Frameworks/regexp/src/glob.cc @@ -225,13 +225,13 @@ namespace path void glob_list_t::add_include_glob (std::string const& glob, kPathItemType itemType) { if(glob != NULL_STR) - _globs.push_back(record_t(false, glob_t(glob, false), itemType)); + _globs.emplace_back(false, glob_t(glob, false), itemType); } void glob_list_t::add_exclude_glob (std::string const& glob, kPathItemType itemType) { if(glob != NULL_STR) - _globs.push_back(record_t(true, glob_t(glob, true), itemType)); + _globs.emplace_back(true, glob_t(glob, true), itemType); } bool glob_list_t::include (std::string const& path, kPathItemType itemType, bool defaultResult) const diff --git a/Frameworks/regexp/src/parser.cc b/Frameworks/regexp/src/parser.cc index 67e860c6..d004c89e 100644 --- a/Frameworks/regexp/src/parser.cc +++ b/Frameworks/regexp/src/parser.cc @@ -82,7 +82,7 @@ struct parse_context_t : parser_base_t std::string& text_node (nodes_t& nodes) { if(nodes.empty() || !boost::get(&nodes.back())) - nodes.push_back(text_t()); + nodes.emplace_back(); return boost::get(nodes.back()).text; } }; @@ -215,11 +215,11 @@ bool parse_context_t::parse_case_change (nodes_t& nodes) { switch(it[-1]) { - case 'U': nodes.push_back(case_change_t(case_change::upper)); break; - case 'L': nodes.push_back(case_change_t(case_change::lower)); break; - case 'E': nodes.push_back(case_change_t(case_change::none)); break; - case 'u': nodes.push_back(case_change_t(case_change::upper_next)); break; - case 'l': nodes.push_back(case_change_t(case_change::lower_next)); break; + case 'U': nodes.emplace_back(case_change::upper); break; + case 'L': nodes.emplace_back(case_change::lower); break; + case 'E': nodes.emplace_back(case_change::none); break; + case 'u': nodes.emplace_back(case_change::upper_next); break; + case 'l': nodes.emplace_back(case_change::lower_next); break; } return true; } @@ -307,9 +307,9 @@ bool parse_context_t::parse_placeholder (nodes_t& nodes) else if(parse_char("|")) { placeholder_choice_t res = { index }; - res.choices.push_back(nodes_t()); + res.choices.emplace_back(); while(parse_format_string(",|", res.choices.back()) && it[-1] == ',') - res.choices.push_back(nodes_t()); + res.choices.emplace_back(); if(it[-1] == '|' && parse_char("}")) return nodes.push_back(res), true; } diff --git a/Frameworks/scope/src/parse.cc b/Frameworks/scope/src/parse.cc index 7779a8aa..6689a746 100644 --- a/Frameworks/scope/src/parse.cc +++ b/Frameworks/scope/src/parse.cc @@ -62,7 +62,7 @@ namespace scope bool rc = false; res.anchor_to_previous = parse_char(">") && ws(); do { - res.atoms.push_back(atom_t()); + res.atoms.emplace_back(); if(!parse_atom(res.atoms.back())) { res.atoms.pop_back(); diff --git a/Frameworks/settings/src/parser.h b/Frameworks/settings/src/parser.h index 9e2121ce..71afceb8 100644 --- a/Frameworks/settings/src/parser.h +++ b/Frameworks/settings/src/parser.h @@ -21,7 +21,7 @@ struct ini_file_t void new_section (std::vector const& names) { - sections.push_back(section_t(names)); + sections.emplace_back(names); } void insert_value (std::string const& name, std::string const& value) diff --git a/Frameworks/settings/src/settings.cc b/Frameworks/settings/src/settings.cc index eefea941..582664a1 100644 --- a/Frameworks/settings/src/settings.cc +++ b/Frameworks/settings/src/settings.cc @@ -129,15 +129,15 @@ namespace if(section->names.empty()) { - res.push_back(section_t(variables)); + res.emplace_back(variables); } else { iterate(name, section->names) { if(is_scope_selector(*name)) - res.push_back(section_t(scope::selector_t(*name), variables)); - else res.push_back(section_t(path::glob_t(*name), variables)); + res.emplace_back(scope::selector_t(*name), variables); + else res.emplace_back(path::glob_t(*name), variables); } } } diff --git a/Frameworks/theme/src/theme.cc b/Frameworks/theme/src/theme.cc index 73c5694a..6270a6b5 100644 --- a/Frameworks/theme/src/theme.cc +++ b/Frameworks/theme/src/theme.cc @@ -91,7 +91,7 @@ std::vector theme_t::global_styles (scope::scope_t plist::any_t const& value = bundles::value_for_setting(colorKeys[i].name, scope, &item); if(item) { - res.push_back(decomposed_style_t(item->scope_selector())); + res.emplace_back(item->scope_selector()); res.back().*(colorKeys[i].field) = read_color(plist::get(value)); } } @@ -102,7 +102,7 @@ std::vector theme_t::global_styles (scope::scope_t plist::any_t const& value = bundles::value_for_setting(booleanKeys[i].name, scope, &item); if(item) { - res.push_back(decomposed_style_t(item->scope_selector())); + res.emplace_back(item->scope_selector()); res.back().*(booleanKeys[i].field) = plist::is_true(value) ? bool_true : bool_false; } } @@ -111,7 +111,7 @@ std::vector theme_t::global_styles (scope::scope_t plist::any_t const& fontNameValue = bundles::value_for_setting("fontName", scope, &fontNameItem); if(fontNameItem) { - res.push_back(decomposed_style_t(fontNameItem->scope_selector())); + res.emplace_back(fontNameItem->scope_selector()); res.back().font_name = plist::get(fontNameValue); } @@ -119,7 +119,7 @@ std::vector theme_t::global_styles (scope::scope_t plist::any_t const& fontSizeValue = bundles::value_for_setting("fontSize", scope, &fontSizeItem); if(fontSizeItem) { - res.push_back(decomposed_style_t(fontSizeItem->scope_selector())); + res.emplace_back(fontSizeItem->scope_selector()); res.back().font_size = read_font_size(plist::get(fontSizeValue)); } diff --git a/Frameworks/undo/src/undo.cc b/Frameworks/undo/src/undo.cc index 331167df..44b246c3 100644 --- a/Frameworks/undo/src/undo.cc +++ b/Frameworks/undo/src/undo.cc @@ -102,7 +102,7 @@ namespace ng void undo_manager_t::will_replace (size_t from, size_t to, std::string const& str) { _records.erase(_records.begin() + _index, _records.end()); - _records.push_back(record_t(from, _buffer.substr(from, to), str, _pre_selection, _pre_revision)); + _records.emplace_back(from, _buffer.substr(from, to), str, _pre_selection, _pre_revision); _pre_selection = ranges_t(); ++_changes; ++_index;