mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
SystemMonitor: Avoid making StringView of temporary ByteBuffer
This commit is contained in:
parent
4ef9a1ba48
commit
2223f22590
Notes:
sideshowbarker
2024-07-18 04:17:40 +09:00
Author: https://github.com/BenWiederhake
Commit: 2223f22590
Pull-request: https://github.com/SerenityOS/serenity/pull/9946
Reviewed-by: https://github.com/IdanHo ✅
1 changed files with 2 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue