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