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.
This commit is contained in:
Karol Kosek 2021-08-12 22:22:44 +02:00 committed by Andreas Kling
parent 5bb6936a2a
commit 4a1974b174
Notes: sideshowbarker 2024-07-19 17:13:17 +09:00
2 changed files with 1 additions and 8 deletions

View file

@ -48,13 +48,7 @@ void Project::for_each_text_file(Function<void(const ProjectFile&)> callback) co
NonnullRefPtr<ProjectFile> 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

View file

@ -36,7 +36,6 @@ private:
String to_absolute_path(const String&) const;
RefPtr<GUI::FileSystemModel> m_model;
mutable NonnullRefPtrVector<ProjectFile> m_files;
String m_root_path;
};