Everywhere: Remove unused local variables and lambda captures

This commit is contained in:
Daniel Bertalan 2021-07-05 18:13:42 +02:00 committed by Gunnar Beutner
parent 5f7f063919
commit ca06fd658d
10 changed files with 10 additions and 15 deletions

View file

@ -295,7 +295,7 @@ void BrowserWindow::build_menus()
};
m_disable_search_engine_action = GUI::Action::create_checkable(
"Disable", [this](auto&) {
"Disable", [](auto&) {
g_search_engine = {};
auto config = Core::ConfigFile::get_for_app("Browser");
config->write_entry("Preferences", "SearchEngine", g_search_engine);

View file

@ -52,8 +52,6 @@ static TitleAndText build_backtrace(const CoreDump::Reader& coredump, const ELF:
builder.append('\n');
};
auto& backtrace_entries = backtrace.entries();
if (metadata.contains("assertion"))
prepend_metadata("assertion", "ASSERTION FAILED: {}");
else if (metadata.contains("pledge_violation"))

View file

@ -699,19 +699,19 @@ NonnullRefPtr<GUI::Widget> build_graphs_tab()
memory_graph.set_stack_values(true);
memory_graph.set_value_format(0, {
.graph_color_role = ColorRole::SyntaxComment,
.text_formatter = [&memory_graph](int value) {
.text_formatter = [](int value) {
return String::formatted("Committed: {} KiB", value);
},
});
memory_graph.set_value_format(1, {
.graph_color_role = ColorRole::SyntaxPreprocessorStatement,
.text_formatter = [&memory_graph](int value) {
.text_formatter = [](int value) {
return String::formatted("Allocated: {} KiB", value);
},
});
memory_graph.set_value_format(2, {
.graph_color_role = ColorRole::SyntaxPreprocessorValue,
.text_formatter = [&memory_graph](int value) {
.text_formatter = [](int value) {
return String::formatted("Kernel heap: {} KiB", value);
},
});

View file

@ -577,7 +577,7 @@ void Editor::on_identifier_click(const GUI::TextDocumentSpan& span)
if (!m_language_client)
return;
m_language_client->on_declaration_found = [this](const String& file, size_t line, size_t column) {
m_language_client->on_declaration_found = [](const String& file, size_t line, size_t column) {
HackStudio::open_file(file, line, column);
};
m_language_client->search_declaration(code_document().file_path(), span.range.start().line(), span.range.start().column());

View file

@ -504,7 +504,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_switch_to_next_editor_action
if (m_all_editor_wrappers.size() <= 1)
return;
Vector<EditorWrapper&> wrappers;
m_editors_splitter->for_each_child_of_type<EditorWrapper>([this, &wrappers](auto& child) {
m_editors_splitter->for_each_child_of_type<EditorWrapper>([&wrappers](auto& child) {
wrappers.append(child);
return IterationDecision::Continue;
});
@ -525,7 +525,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_switch_to_previous_editor_ac
if (m_all_editor_wrappers.size() <= 1)
return;
Vector<EditorWrapper&> wrappers;
m_editors_splitter->for_each_child_of_type<EditorWrapper>([this, &wrappers](auto& child) {
m_editors_splitter->for_each_child_of_type<EditorWrapper>([&wrappers](auto& child) {
wrappers.append(child);
return IterationDecision::Continue;
});

View file

@ -486,7 +486,7 @@ Optional<DebugSession::SymbolicationResult> DebugSession::symbolicate(FlatPtr ad
Optional<DebugInfo::SourcePositionAndAddress> DebugSession::get_address_from_source_position(String const& file, size_t line) const
{
Optional<DebugInfo::SourcePositionAndAddress> result;
for_each_loaded_library([this, file, line, &result](auto& lib) {
for_each_loaded_library([file, line, &result](auto& lib) {
// The loader contains its own definitions for LibC symbols, so we don't want to include it in the search.
if (lib.name == "Loader.so")
return IterationDecision::Continue;

View file

@ -241,7 +241,7 @@ void DwarfInfo::build_cached_dies() const
m_cached_dies_by_range.insert(range.start_address, DIEAndRange { die, range });
m_cached_dies_by_offset.insert(die.offset(), die);
};
auto get_ranges_of_die = [this](DIE const& die) -> Vector<DIERange> {
auto get_ranges_of_die = [](DIE const& die) -> Vector<DIERange> {
// TODO support DW_AT_ranges (appears when range is non-contiguous)
auto start = die.get_attribute(Attribute::LowPc);

View file

@ -161,8 +161,6 @@ void on_max_age_attribute(ParsedCookie& parsed_cookie, StringView attribute_valu
// Let delta-seconds be the attribute-value converted to an integer.
if (auto delta_seconds = attribute_value.to_int(); delta_seconds.has_value()) {
Core::DateTime expiry_time;
if (*delta_seconds <= 0) {
// If delta-seconds is less than or equal to zero (0), let expiry-time be the earliest representable date and time.
parsed_cookie.expiry_time_from_max_age_attribute = Core::DateTime::from_timestamp(0);

View file

@ -1034,7 +1034,6 @@ Messages::WindowServer::GetScreenBitmapAroundCursorResponse ClientConnection::ge
if (auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, rect.size(), 1)) {
auto bounding_screen_src_rect = Screen::bounding_rect().intersected(rect);
Gfx::Painter painter(*bitmap);
Gfx::IntRect last_cursor_rect;
auto& screen_with_cursor = ScreenInput::the().cursor_location_screen();
auto cursor_rect = Compositor::the().current_cursor_rect();
Screen::for_each([&](auto& screen) {

View file

@ -498,7 +498,7 @@ void Menu::start_activation_animation(MenuItem& item)
};
auto animation = adopt_own(*new AnimationInfo(move(window)));
auto& timer = animation->timer;
timer = Core::Timer::create_repeating(50, [this, animation = animation.ptr(), animation_ref = move(animation)] {
timer = Core::Timer::create_repeating(50, [animation = animation.ptr(), animation_ref = move(animation)] {
VERIFY(animation->step % 2 == 0);
animation->step -= 2;
if (animation->step == 0) {