mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
SystemMonitor: Avoid making StringView of temporary ByteBuffer
This commit is contained in:
committed by
Idan Horowitz
parent
4ef9a1ba48
commit
2223f22590
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user