summaryrefslogtreecommitdiff
path: root/Userland/DevTools
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-06-08 19:36:27 +0430
committerAndreas Kling <kling@serenityos.org>2021-06-08 19:14:24 +0200
commit7ac196974de3a85430f4ccd1db883943853d8ae0 (patch)
treeefc838bfc282a16379e1c80b7f3e721a6eb8b297 /Userland/DevTools
parent3d94b5051d8a783858cde04eb4d2e1ecf63ac180 (diff)
downloadserenity-7ac196974de3a85430f4ccd1db883943853d8ae0.zip
Everywhere: Replace Vector<T*> with nonnull entries with Vector<T&>
Diffstat (limited to 'Userland/DevTools')
-rw-r--r--Userland/DevTools/HackStudio/HackStudioWidget.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp
index 8abd23e15b..21d44af2f2 100644
--- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp
+++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp
@@ -489,17 +489,17 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_switch_to_next_editor_action
return GUI::Action::create("Switch to &Next Editor", { Mod_Ctrl, Key_E }, [this](auto&) {
if (m_all_editor_wrappers.size() <= 1)
return;
- Vector<EditorWrapper*> wrappers;
+ Vector<EditorWrapper&> wrappers;
m_editors_splitter->for_each_child_of_type<EditorWrapper>([this, &wrappers](auto& child) {
- wrappers.append(&child);
+ wrappers.append(child);
return IterationDecision::Continue;
});
for (size_t i = 0; i < wrappers.size(); ++i) {
- if (m_current_editor_wrapper.ptr() == wrappers[i]) {
+ if (m_current_editor_wrapper.ptr() == &wrappers[i]) {
if (i == wrappers.size() - 1)
- wrappers[0]->editor().set_focus(true);
+ wrappers[0].editor().set_focus(true);
else
- wrappers[i + 1]->editor().set_focus(true);
+ wrappers[i + 1].editor().set_focus(true);
}
}
});
@@ -510,17 +510,17 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_switch_to_previous_editor_ac
return GUI::Action::create("Switch to &Previous Editor", { Mod_Ctrl | Mod_Shift, Key_E }, [this](auto&) {
if (m_all_editor_wrappers.size() <= 1)
return;
- Vector<EditorWrapper*> wrappers;
+ Vector<EditorWrapper&> wrappers;
m_editors_splitter->for_each_child_of_type<EditorWrapper>([this, &wrappers](auto& child) {
- wrappers.append(&child);
+ wrappers.append(child);
return IterationDecision::Continue;
});
for (int i = wrappers.size() - 1; i >= 0; --i) {
- if (m_current_editor_wrapper.ptr() == wrappers[i]) {
+ if (m_current_editor_wrapper.ptr() == &wrappers[i]) {
if (i == 0)
- wrappers.last()->editor().set_focus(true);
+ wrappers.last().editor().set_focus(true);
else
- wrappers[i - 1]->editor().set_focus(true);
+ wrappers[i - 1].editor().set_focus(true);
}
}
});