mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel/ProcFS: Avoid String allocation when traversing /proc/PID/fd/
This commit is contained in:
parent
45a5cf95f9
commit
1ea604adb1
Notes:
sideshowbarker
2024-07-18 05:35:31 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/1ea604adb19
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue