diff --git a/AK/Vector.h b/AK/Vector.h index 609c589fc3..716fa5ff13 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -227,15 +227,15 @@ public: VERIFY(did_allocate); } - void append(Vector&& other) + void extend(Vector&& other) { - auto did_allocate = try_append(move(other)); + auto did_allocate = try_extend(move(other)); VERIFY(did_allocate); } - void append(Vector const& other) + void extend(Vector const& other) { - auto did_allocate = try_append(other); + auto did_allocate = try_extend(other); VERIFY(did_allocate); } @@ -506,7 +506,7 @@ public: return true; } - [[nodiscard]] bool try_append(Vector&& other) + [[nodiscard]] bool try_extend(Vector&& other) { if (is_empty()) { *this = move(other); @@ -521,7 +521,7 @@ public: return true; } - [[nodiscard]] bool try_append(Vector const& other) + [[nodiscard]] bool try_extend(Vector const& other) { if (!try_grow_capacity(size() + other.size())) return false; diff --git a/Kernel/FileSystem/Ext2FileSystem.cpp b/Kernel/FileSystem/Ext2FileSystem.cpp index 2557fff3ff..6ef1eebe37 100644 --- a/Kernel/FileSystem/Ext2FileSystem.cpp +++ b/Kernel/FileSystem/Ext2FileSystem.cpp @@ -920,7 +920,7 @@ KResult Ext2FSInode::resize(u64 new_size) auto blocks_or_error = fs().allocate_blocks(fs().group_index_from_inode(index()), blocks_needed_after - blocks_needed_before); if (blocks_or_error.is_error()) return blocks_or_error.error(); - if (!m_block_list.try_append(blocks_or_error.release_value())) + if (!m_block_list.try_extend(blocks_or_error.release_value())) return ENOMEM; } else if (blocks_needed_after < blocks_needed_before) { if constexpr (EXT2_VERY_DEBUG) { diff --git a/Kernel/VM/Space.cpp b/Kernel/VM/Space.cpp index 543448c3a9..bb8bc68b29 100644 --- a/Kernel/VM/Space.cpp +++ b/Kernel/VM/Space.cpp @@ -119,7 +119,7 @@ KResult Space::unmap_mmap_range(VirtualAddress addr, size_t size) region->unmap(Region::ShouldDeallocateVirtualMemoryRange::No); // Otherwise just split the regions and collect them for future mapping - if (new_regions.try_append(split_region_around_range(*region, range_to_unmap))) + if (new_regions.try_extend(split_region_around_range(*region, range_to_unmap))) return ENOMEM; } // Instead we give back the unwanted VM manually at the end. diff --git a/Tests/AK/TestVector.cpp b/Tests/AK/TestVector.cpp index bbae27fa56..bf3d807431 100644 --- a/Tests/AK/TestVector.cpp +++ b/Tests/AK/TestVector.cpp @@ -209,7 +209,7 @@ BENCHMARK_CASE(vector_append_trivial) } for (int i = 0; i < 100; ++i) { Vector tmp; - tmp.append(ints); + tmp.extend(ints); EXPECT_EQ(tmp.size(), 1000000u); } } @@ -450,7 +450,7 @@ TEST_CASE(can_store_references) { Vector other_references; - other_references.append(references); + other_references.extend(references); EXPECT_EQ(&other_references.first(), &my_integer); } diff --git a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp index 00cdf6ee0a..0f29992617 100644 --- a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp +++ b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp @@ -286,7 +286,7 @@ void TreeMapWidget::mousedown_event(GUI::MouseEvent& event) Vector path = path_to_position(event.position()); if (!path.is_empty()) { m_path.shrink(m_viewpoint); - m_path.append(path); + m_path.extend(path); if (on_path_change) { on_path_change(); } @@ -303,7 +303,7 @@ void TreeMapWidget::doubleclick_event(GUI::MouseEvent& event) if (node && !node_is_leaf(*node)) { Vector path = path_to_position(event.position()); m_path.shrink(m_viewpoint); - m_path.append(path); + m_path.extend(path); m_viewpoint = m_path.size(); if (on_path_change) { on_path_change(); diff --git a/Userland/Applications/Spreadsheet/ExportDialog.cpp b/Userland/Applications/Spreadsheet/ExportDialog.cpp index 639eadc5ad..c648e8c4ed 100644 --- a/Userland/Applications/Spreadsheet/ExportDialog.cpp +++ b/Userland/Applications/Spreadsheet/ExportDialog.cpp @@ -36,7 +36,7 @@ namespace Spreadsheet { CSVExportDialogPage::CSVExportDialogPage(const Sheet& sheet) : m_data(sheet.to_xsv()) { - m_headers.append(m_data.take_first()); + m_headers.extend(m_data.take_first()); auto temp_template = String::formatted("{}/spreadsheet-csv-export.{}.XXXXXX", Core::StandardPaths::tempfile_directory(), getpid()); auto temp_path = ByteBuffer::create_uninitialized(temp_template.length() + 1); diff --git a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp index db30b7b55b..5b7e99c99d 100644 --- a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp +++ b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp @@ -321,7 +321,7 @@ void SpreadsheetWidget::add_sheet(NonnullRefPtr&& sheet) NonnullRefPtrVector new_sheets; new_sheets.append(move(sheet)); - m_workbook->sheets().append(new_sheets); + m_workbook->sheets().extend(new_sheets); setup_tabs(new_sheets); } diff --git a/Userland/DevTools/HackStudio/Git/GitRepo.cpp b/Userland/DevTools/HackStudio/Git/GitRepo.cpp index f42f832994..f38c18aea4 100644 --- a/Userland/DevTools/HackStudio/Git/GitRepo.cpp +++ b/Userland/DevTools/HackStudio/Git/GitRepo.cpp @@ -37,7 +37,7 @@ Vector GitRepo::unstaged_files() const { auto modified = modified_files(); auto untracked = untracked_files(); - modified.append(move(untracked)); + modified.extend(move(untracked)); return modified; } // diff --git a/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.cpp b/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.cpp index acfab18d8e..c403669c73 100644 --- a/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.cpp +++ b/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.cpp @@ -325,7 +325,7 @@ Vector CppComprehensionEngine::get_child_symbols auto new_scope = scope; new_scope.append(decl.name()); - symbols.append(get_child_symbols(decl, new_scope, are_child_symbols_local ? Symbol::IsLocal::Yes : is_local)); + symbols.extend(get_child_symbols(decl, new_scope, are_child_symbols_local ? Symbol::IsLocal::Yes : is_local)); } return symbols; diff --git a/Userland/DevTools/Inspector/RemoteObjectPropertyModel.cpp b/Userland/DevTools/Inspector/RemoteObjectPropertyModel.cpp index dee2a0a28f..a27e0de92a 100644 --- a/Userland/DevTools/Inspector/RemoteObjectPropertyModel.cpp +++ b/Userland/DevTools/Inspector/RemoteObjectPropertyModel.cpp @@ -92,7 +92,7 @@ GUI::ModelIndex RemoteObjectPropertyModel::index(int row, int column, const GUI: auto nth_child = [&](int n, const JsonValue& value) -> const JsonPath* { auto path = make(); - path->append(parent_path); + path->extend(parent_path); int row_index = n; if (value.is_object()) { String property_name; diff --git a/Userland/DevTools/Playground/GMLAutocompleteProvider.cpp b/Userland/DevTools/Playground/GMLAutocompleteProvider.cpp index 4fc0b46562..2d88ea5da0 100644 --- a/Userland/DevTools/Playground/GMLAutocompleteProvider.cpp +++ b/Userland/DevTools/Playground/GMLAutocompleteProvider.cpp @@ -202,8 +202,8 @@ void GMLAutocompleteProvider::provide_completions(Function)> quick_sort(identifier_entries, [](auto& a, auto& b) { return a.completion < b.completion; }); Vector entries; - entries.append(move(identifier_entries)); - entries.append(move(class_entries)); + entries.extend(move(identifier_entries)); + entries.extend(move(class_entries)); callback(move(entries)); } diff --git a/Userland/Libraries/LibCore/EventLoop.cpp b/Userland/Libraries/LibCore/EventLoop.cpp index 5fee393e47..c9c4b78b27 100644 --- a/Userland/Libraries/LibCore/EventLoop.cpp +++ b/Userland/Libraries/LibCore/EventLoop.cpp @@ -405,7 +405,7 @@ void EventLoop::pump(WaitMode mode) new_event_queue.ensure_capacity(m_queued_events.size() + events.size()); for (++i; i < events.size(); ++i) new_event_queue.unchecked_append(move(events[i])); - new_event_queue.append(move(m_queued_events)); + new_event_queue.extend(move(m_queued_events)); m_queued_events = move(new_event_queue); return; } diff --git a/Userland/Libraries/LibCore/EventLoop.h b/Userland/Libraries/LibCore/EventLoop.h index c2d03307ef..e97c83dc5e 100644 --- a/Userland/Libraries/LibCore/EventLoop.h +++ b/Userland/Libraries/LibCore/EventLoop.h @@ -58,7 +58,7 @@ public: void take_pending_events_from(EventLoop& other) { - m_queued_events.append(move(other.m_queued_events)); + m_queued_events.extend(move(other.m_queued_events)); } static void wake(); diff --git a/Userland/Libraries/LibCpp/AST.cpp b/Userland/Libraries/LibCpp/AST.cpp index 1428c2624b..69fc15a0e4 100644 --- a/Userland/Libraries/LibCpp/AST.cpp +++ b/Userland/Libraries/LibCpp/AST.cpp @@ -63,7 +63,7 @@ NonnullRefPtrVector FunctionDeclaration::declarations() const } if (m_definition) - declarations.append(m_definition->declarations()); + declarations.extend(m_definition->declarations()); return declarations; } @@ -131,7 +131,7 @@ NonnullRefPtrVector FunctionDefinition::declarations() const { NonnullRefPtrVector declarations; for (auto& statement : m_statements) { - declarations.append(statement.declarations()); + declarations.extend(statement.declarations()); } return declarations; } @@ -400,9 +400,9 @@ NonnullRefPtrVector ForStatement::declarations() const { NonnullRefPtrVector declarations; if (m_init) - declarations.append(m_init->declarations()); + declarations.extend(m_init->declarations()); if (m_body) - declarations.append(m_body->declarations()); + declarations.extend(m_body->declarations()); return declarations; } @@ -410,7 +410,7 @@ NonnullRefPtrVector BlockStatement::declarations() const { NonnullRefPtrVector declarations; for (auto& statement : m_statements) { - declarations.append(statement.declarations()); + declarations.extend(statement.declarations()); } return declarations; } @@ -439,11 +439,11 @@ NonnullRefPtrVector IfStatement::declarations() const { NonnullRefPtrVector declarations; if (m_predicate) - declarations.append(m_predicate->declarations()); + declarations.extend(m_predicate->declarations()); if (m_then) - declarations.append(m_then->declarations()); + declarations.extend(m_then->declarations()); if (m_else) - declarations.append(m_else->declarations()); + declarations.extend(m_else->declarations()); return declarations; } diff --git a/Userland/Libraries/LibDebug/DebugInfo.cpp b/Userland/Libraries/LibDebug/DebugInfo.cpp index d460e5285e..3d38da4d91 100644 --- a/Userland/Libraries/LibDebug/DebugInfo.cpp +++ b/Userland/Libraries/LibDebug/DebugInfo.cpp @@ -87,7 +87,7 @@ void DebugInfo::prepare_lines() Vector all_lines; while (!stream.eof()) { Dwarf::LineProgram program(m_dwarf_info, stream); - all_lines.append(program.lines()); + all_lines.extend(program.lines()); } HashMap> memoized_full_paths; diff --git a/Userland/Libraries/LibGUI/FileSystemModel.cpp b/Userland/Libraries/LibGUI/FileSystemModel.cpp index 696f1ddd03..3ee912cd2b 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.cpp +++ b/Userland/Libraries/LibGUI/FileSystemModel.cpp @@ -123,8 +123,8 @@ void FileSystemModel::Node::traverse_if_needed() file_children.append(move(child)); } - children.append(move(directory_children)); - children.append(move(file_children)); + children.extend(move(directory_children)); + children.extend(move(file_children)); if (!m_model.m_file_watcher->is_watching(full_path)) { // We are not already watching this file, watch it diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp index 96fbdd0338..d9a9e92456 100644 --- a/Userland/Libraries/LibGUI/Window.cpp +++ b/Userland/Libraries/LibGUI/Window.cpp @@ -380,7 +380,7 @@ void Window::handle_multi_paint_event(MultiPaintEvent& event) // It's possible that there had been some calls to update() that // haven't been flushed. We can handle these right now, avoiding // another round trip. - rects.append(move(m_pending_paint_event_rects)); + rects.extend(move(m_pending_paint_event_rects)); } VERIFY(!rects.is_empty()); if (m_back_store && m_back_store->size() != event.window_size()) { diff --git a/Userland/Libraries/LibGfx/BMPLoader.cpp b/Userland/Libraries/LibGfx/BMPLoader.cpp index a8a30d1e9d..059ebd246d 100644 --- a/Userland/Libraries/LibGfx/BMPLoader.cpp +++ b/Userland/Libraries/LibGfx/BMPLoader.cpp @@ -424,9 +424,9 @@ static bool set_dib_bitmasks(BMPLoadingContext& context, InputStreamer& streamer auto& type = context.dib_type; if (type > DIBType::OSV2 && bpp == 16 && compression == Compression::RGB) { - context.dib.info.masks.append({ 0x7c00, 0x03e0, 0x001f }); - context.dib.info.mask_shifts.append({ 7, 2, -3 }); - context.dib.info.mask_sizes.append({ 5, 5, 5 }); + context.dib.info.masks.extend({ 0x7c00, 0x03e0, 0x001f }); + context.dib.info.mask_shifts.extend({ 7, 2, -3 }); + context.dib.info.mask_sizes.extend({ 5, 5, 5 }); } else if (type == DIBType::Info && (compression == Compression::BITFIELDS || compression == Compression::ALPHABITFIELDS)) { // Consume the extra BITFIELDS bytes auto number_of_mask_fields = compression == Compression::ALPHABITFIELDS ? 4 : 3; diff --git a/Userland/Libraries/LibGfx/GIFLoader.cpp b/Userland/Libraries/LibGfx/GIFLoader.cpp index a4d9a9d497..21f64ec57b 100644 --- a/Userland/Libraries/LibGfx/GIFLoader.cpp +++ b/Userland/Libraries/LibGfx/GIFLoader.cpp @@ -160,7 +160,7 @@ public: void reset() { m_code_table.clear(); - m_code_table.append(m_original_code_table); + m_code_table.extend(m_original_code_table); m_code_size = m_original_code_size; m_table_capacity = pow(2, m_code_size); m_output.clear(); diff --git a/Userland/Libraries/LibGfx/PNGWriter.cpp b/Userland/Libraries/LibGfx/PNGWriter.cpp index 5f529062be..16026eaf1c 100644 --- a/Userland/Libraries/LibGfx/PNGWriter.cpp +++ b/Userland/Libraries/LibGfx/PNGWriter.cpp @@ -129,7 +129,7 @@ void PNGWriter::add_chunk(PNGChunk const& png_chunk) for (auto character : png_chunk.type()) { combined.append(character); } - combined.append(png_chunk.data()); + combined.extend(png_chunk.data()); auto crc = BigEndian(Crypto::Checksum::CRC32({ (const u8*)combined.data(), combined.size() }).digest()); auto data_len = BigEndian(png_chunk.data().size()); diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index 53cc8da0f6..c5c7dfc12a 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -2230,12 +2230,12 @@ Value DebuggerStatement::execute(Interpreter& interpreter, GlobalObject&) const void ScopeNode::add_variables(NonnullRefPtrVector variables) { - m_variables.append(move(variables)); + m_variables.extend(move(variables)); } void ScopeNode::add_functions(NonnullRefPtrVector functions) { - m_functions.append(move(functions)); + m_functions.extend(move(functions)); } } diff --git a/Userland/Libraries/LibJS/Runtime/Function.cpp b/Userland/Libraries/LibJS/Runtime/Function.cpp index e4c75c51cc..debf747aa9 100644 --- a/Userland/Libraries/LibJS/Runtime/Function.cpp +++ b/Userland/Libraries/LibJS/Runtime/Function.cpp @@ -61,7 +61,7 @@ BoundFunction* Function::bind(Value bound_this_value, Vector arguments) constructor_prototype = &prototype_property.as_object(); auto all_bound_arguments = bound_arguments(); - all_bound_arguments.append(move(arguments)); + all_bound_arguments.extend(move(arguments)); return heap().allocate(global_object(), global_object(), target_function, bound_this_object, move(all_bound_arguments), computed_length, constructor_prototype); } diff --git a/Userland/Libraries/LibJS/Runtime/MarkedValueList.h b/Userland/Libraries/LibJS/Runtime/MarkedValueList.h index 251ff57b52..cd73edb952 100644 --- a/Userland/Libraries/LibJS/Runtime/MarkedValueList.h +++ b/Userland/Libraries/LibJS/Runtime/MarkedValueList.h @@ -28,7 +28,7 @@ public: MarkedValueList copy() const { MarkedValueList copy { m_heap }; - copy.append(*this); + copy.extend(*this); return copy; } diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp index bd36f9986c..e22e06198c 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp @@ -373,7 +373,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_replace) if (replace_value.is_function()) { MarkedValueList replacer_args(vm.heap()); replacer_args.append(js_string(vm, matched)); - replacer_args.append(move(captures)); + replacer_args.extend(move(captures)); replacer_args.append(Value(position)); replacer_args.append(js_string(vm, string)); if (!named_captures.is_undefined()) { diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index cac6ad2675..34dec185b9 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -397,7 +397,7 @@ Value VM::construct(Function& function, Function& new_target, Optional> parse_until_any_of(InputStream& str if (parse_result.is_error()) return parse_result.error(); - result.values.append(parse_result.release_value()); + result.values.extend(parse_result.release_value()); } } @@ -312,7 +312,7 @@ ParseResult> Instruction::parse(InputStream& stream, Instruc // Transform op(..., instr*, instr*) -> op(...) instr* op(else(ip) instr* op(end(ip)) VERIFY(result.value().terminator == 0x05); - instructions.append(result.release_value().values); + instructions.extend(result.release_value().values); instructions.append(Instruction { Instructions::structured_else }); ++ip; else_ip = ip.value(); @@ -322,7 +322,7 @@ ParseResult> Instruction::parse(InputStream& stream, Instruc auto result = parse_until_any_of(stream, ip); if (result.is_error()) return result.error(); - instructions.append(result.release_value().values); + instructions.extend(result.release_value().values); instructions.append(Instruction { Instructions::structured_end }); ++ip; end_ip = ip.value(); diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp index 7331956fb5..9ed1607083 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp @@ -1560,8 +1560,7 @@ _StartOfFunction: log_parse_error(); } - m_temporary_buffer.clear(); - m_temporary_buffer.append(match.value().code_points); + m_temporary_buffer = match.value().code_points; FLUSH_CODEPOINTS_CONSUMED_AS_A_CHARACTER_REFERENCE; SWITCH_TO_RETURN_STATE; diff --git a/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp b/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp index fe899e5940..d08ea0c11f 100644 --- a/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp +++ b/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp @@ -99,7 +99,7 @@ void SyntaxHighlighter::rehighlight(Palette const& palette) register_nested_token_pairs(proxy_client.corrected_token_pairs(highlighter.matching_token_pairs())); } - spans.append(proxy_client.corrected_spans()); + spans.extend(proxy_client.corrected_spans()); substring_builder.clear(); } else if (state == State::CSS) { // FIXME: Highlight CSS code here instead. diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp index b758bc867e..fb16b3383f 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp @@ -279,23 +279,23 @@ Vector> PathDataParser::parse_coordinate_pair_sequence() Vector PathDataParser::parse_coordinate_pair_double() { Vector coordinates; - coordinates.append(parse_coordinate_pair()); + coordinates.extend(parse_coordinate_pair()); if (match_comma_whitespace()) parse_comma_whitespace(); - coordinates.append(parse_coordinate_pair()); + coordinates.extend(parse_coordinate_pair()); return coordinates; } Vector PathDataParser::parse_coordinate_pair_triplet() { Vector coordinates; - coordinates.append(parse_coordinate_pair()); + coordinates.extend(parse_coordinate_pair()); if (match_comma_whitespace()) parse_comma_whitespace(); - coordinates.append(parse_coordinate_pair()); + coordinates.extend(parse_coordinate_pair()); if (match_comma_whitespace()) parse_comma_whitespace(); - coordinates.append(parse_coordinate_pair()); + coordinates.extend(parse_coordinate_pair()); return coordinates; } @@ -316,7 +316,7 @@ Vector PathDataParser::parse_elliptical_arg_argument() numbers.append(parse_flag()); if (match_comma_whitespace()) parse_comma_whitespace(); - numbers.append(parse_coordinate_pair()); + numbers.extend(parse_coordinate_pair()); return numbers; } diff --git a/Userland/Services/AudioServer/Mixer.cpp b/Userland/Services/AudioServer/Mixer.cpp index 8e5d8b785b..e1ed63d1ce 100644 --- a/Userland/Services/AudioServer/Mixer.cpp +++ b/Userland/Services/AudioServer/Mixer.cpp @@ -59,7 +59,7 @@ void Mixer::mix() if (active_mix_queues.is_empty() || m_added_queue) { pthread_mutex_lock(&m_pending_mutex); pthread_cond_wait(&m_pending_cond, &m_pending_mutex); - active_mix_queues.append(move(m_pending_mixing)); + active_mix_queues.extend(move(m_pending_mixing)); pthread_mutex_unlock(&m_pending_mutex); m_added_queue = false; } diff --git a/Userland/Shell/AST.cpp b/Userland/Shell/AST.cpp index 8bdc8f69d1..78a40cc31c 100644 --- a/Userland/Shell/AST.cpp +++ b/Userland/Shell/AST.cpp @@ -133,11 +133,11 @@ static inline Vector join_commands(Vector left, Vector join_commands(Vector left, Vector commands; - commands.append(left); + commands.extend(left); commands.append(command); - commands.append(right); + commands.extend(right); return commands; } @@ -463,7 +463,7 @@ RefPtr ListConcatenate::run(RefPtr shell) NonnullRefPtrVector values; if (result->is_list_without_resolution()) { - values.append(static_cast(result.ptr())->values()); + values.extend(static_cast(result.ptr())->values()); } else { for (auto& result : result->resolve_as_list(shell)) values.append(create(result)); @@ -1107,7 +1107,7 @@ Vector FunctionDeclaration::complete_for_editor(Shel results.append(arg.name); } - results.append(matching_node->complete_for_editor(shell, offset, hit_test_result)); + results.extend(matching_node->complete_for_editor(shell, offset, hit_test_result)); return results; } @@ -2069,7 +2069,7 @@ RefPtr MatchExpr::run(RefPtr shell) } else { auto list = option.run(shell); option.for_each_entry(shell, [&](auto&& value) { - pattern.append(value->resolve_as_list(nullptr)); // Note: 'nullptr' incurs special behaviour, + pattern.extend(value->resolve_as_list(nullptr)); // Note: 'nullptr' incurs special behaviour, // asking the node for a 'raw' value. return IterationDecision::Continue; }); @@ -2276,10 +2276,10 @@ RefPtr Pipe::run(RefPtr shell) } Vector commands; - commands.append(left); + commands.extend(left); commands.append(last_in_left); commands.append(first_in_right); - commands.append(right); + commands.extend(right); return create(move(commands)); } @@ -2556,7 +2556,7 @@ RefPtr Sequence::run(RefPtr shell) for (auto& entry : m_entries) { if (!last_command_in_sequence) { auto commands = entry.to_lazy_evaluated_commands(shell); - all_commands.append(move(commands)); + all_commands.extend(move(commands)); last_command_in_sequence = &all_commands.last(); continue; } @@ -2564,7 +2564,7 @@ RefPtr Sequence::run(RefPtr shell) if (last_command_in_sequence->should_wait) { last_command_in_sequence->next_chain.append(NodeWithAction { entry, NodeWithAction::Sequence }); } else { - all_commands.append(entry.to_lazy_evaluated_commands(shell)); + all_commands.extend(entry.to_lazy_evaluated_commands(shell)); last_command_in_sequence = &all_commands.last(); } } @@ -3274,7 +3274,7 @@ NonnullRefPtr Value::with_slices(NonnullRefPtr slice) const& NonnullRefPtr Value::with_slices(NonnullRefPtrVector slices) const& { auto value = clone(); - value->m_slices.append(move(slices)); + value->m_slices.extend(move(slices)); return value; } @@ -3286,7 +3286,7 @@ Vector ListValue::resolve_as_list(RefPtr shell) { Vector values; for (auto& value : m_contained_values) - values.append(value.resolve_as_list(shell)); + values.extend(value.resolve_as_list(shell)); return resolve_slices(shell, move(values), m_slices); } diff --git a/Userland/Shell/ImmediateFunctions.cpp b/Userland/Shell/ImmediateFunctions.cpp index b0cef10e58..edb926f608 100644 --- a/Userland/Shell/ImmediateFunctions.cpp +++ b/Userland/Shell/ImmediateFunctions.cpp @@ -366,7 +366,7 @@ RefPtr Shell::immediate_concat_lists(AST::ImmediateExpression& invoki for (auto& argument : arguments) { if (auto* list = dynamic_cast(&argument)) { - result.append(list->list()); + result.extend(list->list()); } else { auto list_of_values = const_cast(argument).run(this)->resolve_without_cast(this); if (auto* list = dynamic_cast(list_of_values.ptr())) { diff --git a/Userland/Shell/Parser.cpp b/Userland/Shell/Parser.cpp index f615547727..843ec639cd 100644 --- a/Userland/Shell/Parser.cpp +++ b/Userland/Shell/Parser.cpp @@ -175,8 +175,8 @@ RefPtr Parser::parse_toplevel() if (result.entries.is_empty()) break; - sequence.append(move(result.entries)); - positions.append(move(result.separator_positions)); + sequence.extend(move(result.entries)); + positions.extend(move(result.separator_positions)); } while (result.decision == ShouldReadMoreSequences::Yes); if (sequence.is_empty()) @@ -353,7 +353,7 @@ RefPtr Parser::parse_variable_decls() VERIFY(rest->is_variable_decls()); auto* rest_decl = static_cast(rest.ptr()); - variables.append(rest_decl->variables()); + variables.extend(rest_decl->variables()); return create(move(variables)); } diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp index d7069dd654..6f247d6485 100644 --- a/Userland/Shell/Shell.cpp +++ b/Userland/Shell/Shell.cpp @@ -269,7 +269,7 @@ Vector Shell::expand_globs(Vector path_segments, const Strin if (!base.ends_with('/')) builder.append('/'); builder.append(path); - result.append(expand_globs(path_segments, builder.string_view())); + result.extend(expand_globs(path_segments, builder.string_view())); } } @@ -589,7 +589,7 @@ RefPtr Shell::run_command(const AST::Command& command) // If the command is empty, store the redirections and apply them to all later commands. if (command.argv.is_empty() && !command.should_immediately_execute_next) { - m_global_redirections.append(command.redirections); + m_global_redirections.extend(command.redirections); for (auto& next_in_chain : command.next_chain) run_tail(command, next_in_chain, last_return_code); return nullptr; diff --git a/Userland/Utilities/du.cpp b/Userland/Utilities/du.cpp index f1ab20d4a7..0034ef9714 100644 --- a/Userland/Utilities/du.cpp +++ b/Userland/Utilities/du.cpp @@ -113,7 +113,7 @@ int parse_args(int argc, char** argv, Vector& files, DuOption& du_option const auto buff = file->read_all(); if (!buff.is_empty()) { String patterns = String::copy(buff, Chomp); - du_option.excluded_patterns.append(patterns.split('\n')); + du_option.excluded_patterns.extend(patterns.split('\n')); } }