diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2021-09-10 23:43:25 +0200 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2021-09-11 13:22:51 +0300 |
commit | d9c1162a20c4c76a6ba05e5e83fbe8531eba2c3e (patch) | |
tree | 2187302c05610ce214de7e18f56032901b7b256c /Userland/Utilities/nproc.cpp | |
parent | 6c8eea6f5edc87c76a1669bc4a02ebf254304c1e (diff) | |
download | serenity-d9c1162a20c4c76a6ba05e5e83fbe8531eba2c3e.zip |
nproc: Avoid making StringView of temporary ByteBuffer
Diffstat (limited to 'Userland/Utilities/nproc.cpp')
-rw-r--r-- | Userland/Utilities/nproc.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Utilities/nproc.cpp b/Userland/Utilities/nproc.cpp index 071344069d..588b112605 100644 --- a/Userland/Utilities/nproc.cpp +++ b/Userland/Utilities/nproc.cpp @@ -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()); |