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; };