nproc: Avoid making StringView of temporary ByteBuffer

This commit is contained in:
Ben Wiederhake 2021-09-10 23:43:25 +02:00 committed by Idan Horowitz
commit d9c1162a20
Notes: sideshowbarker 2024-07-18 04:17:33 +09:00

View file

@ -22,7 +22,8 @@ int main()
return 1;
}
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();
outln("{}", cpuinfo_array.size());