diff options
author | Andreas Kling <kling@serenityos.org> | 2021-08-17 01:15:34 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-17 01:21:47 +0200 |
commit | 1ea604adb19ba5855057d44a4f7a66687cd70363 (patch) | |
tree | ad9197d5bd03e5d955875a1cb3979a76cf0de0e5 /Kernel/ProcessSpecificExposed.cpp | |
parent | 45a5cf95f9e20949687e18008ff6758142b2750b (diff) | |
download | serenity-1ea604adb19ba5855057d44a4f7a66687cd70363.zip |
Kernel/ProcFS: Avoid String allocation when traversing /proc/PID/fd/
Diffstat (limited to 'Kernel/ProcessSpecificExposed.cpp')
-rw-r--r-- | Kernel/ProcessSpecificExposed.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Kernel/ProcessSpecificExposed.cpp b/Kernel/ProcessSpecificExposed.cpp index 1ed2820f94..30f803f229 100644 --- a/Kernel/ProcessSpecificExposed.cpp +++ b/Kernel/ProcessSpecificExposed.cpp @@ -97,8 +97,9 @@ KResult Process::traverse_file_descriptions_directory(unsigned fsid, Function<bo count++; return; } - InodeIdentifier identifier = { fsid, SegmentedProcFSIndex::build_segmented_index_for_file_description(pid(), count) }; - callback({ String::number(count), identifier, 0 }); + StringBuilder builder; + builder.appendff("{}", count); + callback({ builder.string_view(), { fsid, SegmentedProcFSIndex::build_segmented_index_for_file_description(pid(), count) }, 0 }); count++; }); return KSuccess; |