diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2021-09-10 23:42:56 +0200 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2021-09-11 13:22:51 +0300 |
commit | 2223f22590f4feb80f259bcced5e84ebb72b8f10 (patch) | |
tree | d19f8fa87be6de886c9820f314f6753b7c9f5e6e /Userland/Applications | |
parent | 4ef9a1ba48c23887a91ab30323685d4b4bf3e50c (diff) | |
download | serenity-2223f22590f4feb80f259bcced5e84ebb72b8f10.zip |
SystemMonitor: Avoid making StringView of temporary ByteBuffer
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/SystemMonitor/ProcessModel.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Applications/SystemMonitor/ProcessModel.cpp b/Userland/Applications/SystemMonitor/ProcessModel.cpp index 759361d431..3a7035b163 100644 --- a/Userland/Applications/SystemMonitor/ProcessModel.cpp +++ b/Userland/Applications/SystemMonitor/ProcessModel.cpp @@ -26,7 +26,8 @@ ProcessModel::ProcessModel() auto file = Core::File::construct("/proc/cpuinfo"); if (file->open(Core::OpenMode::ReadOnly)) { - auto json = JsonValue::from_string({ file->read_all() }); + auto buffer = file->read_all(); + auto json = JsonValue::from_string({ buffer }); auto cpuinfo_array = json.value().as_array(); cpuinfo_array.for_each([&](auto& value) { auto& cpu_object = value.as_object(); |