mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:18:12 +00:00
Kernel: Deduplicate signpost perf event strings
This commit is contained in:
parent
d600f0d5b3
commit
e1e91f6c85
2 changed files with 3 additions and 3 deletions
|
@ -169,7 +169,7 @@ KResult PerformanceEventBuffer::to_json_impl(Serializer& object) const
|
|||
{
|
||||
auto strings = object.add_array("strings");
|
||||
for (auto& it : m_strings) {
|
||||
strings.add(it.view());
|
||||
strings.add(it->view());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -309,7 +309,7 @@ KResultOr<FlatPtr> PerformanceEventBuffer::register_string(NonnullOwnPtr<KString
|
|||
{
|
||||
FlatPtr string_id = m_strings.size();
|
||||
|
||||
if (!m_strings.try_append(move(string)))
|
||||
if (m_strings.try_set(move(string)) == AK::HashSetResult::Failed)
|
||||
return ENOBUFS;
|
||||
|
||||
return string_id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue