mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 12:17:44 +00:00
SystemMonitor: Avoid making StringView of temporary ByteBuffer
This commit is contained in:
parent
4ef9a1ba48
commit
2223f22590
1 changed files with 2 additions and 1 deletions
|
@ -26,7 +26,8 @@ ProcessModel::ProcessModel()
|
||||||
|
|
||||||
auto file = Core::File::construct("/proc/cpuinfo");
|
auto file = Core::File::construct("/proc/cpuinfo");
|
||||||
if (file->open(Core::OpenMode::ReadOnly)) {
|
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();
|
auto cpuinfo_array = json.value().as_array();
|
||||||
cpuinfo_array.for_each([&](auto& value) {
|
cpuinfo_array.for_each([&](auto& value) {
|
||||||
auto& cpu_object = value.as_object();
|
auto& cpu_object = value.as_object();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue