From 4a1974b1745049cf28197e75df54133b5d231b58 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Thu, 12 Aug 2021 22:22:44 +0200 Subject: [PATCH] HackStudio: Remove storing a vector of opened files in Project class It looks to me like this has the same purpose as m_open_files in the HackStudioWidget, so removing it shouldn't change anything. --- Userland/DevTools/HackStudio/Project.cpp | 8 +------- Userland/DevTools/HackStudio/Project.h | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Userland/DevTools/HackStudio/Project.cpp b/Userland/DevTools/HackStudio/Project.cpp index 1ffdbebfc0..a56a736dea 100644 --- a/Userland/DevTools/HackStudio/Project.cpp +++ b/Userland/DevTools/HackStudio/Project.cpp @@ -48,13 +48,7 @@ void Project::for_each_text_file(Function callback) co NonnullRefPtr Project::get_file(const String& path) const { auto full_path = to_absolute_path(path); - for (auto& file : m_files) { - if (file.name() == full_path) - return file; - } - auto file = ProjectFile::construct_with_name(full_path); - m_files.append(file); - return file; + return ProjectFile::construct_with_name(full_path); } String Project::to_absolute_path(const String& path) const diff --git a/Userland/DevTools/HackStudio/Project.h b/Userland/DevTools/HackStudio/Project.h index 88fd68f680..5071eff8d0 100644 --- a/Userland/DevTools/HackStudio/Project.h +++ b/Userland/DevTools/HackStudio/Project.h @@ -36,7 +36,6 @@ private: String to_absolute_path(const String&) const; RefPtr m_model; - mutable NonnullRefPtrVector m_files; String m_root_path; };