mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
Kernel: Make PerformanceEventBuffer::to_json() return a KResult
There's a ton of things inside to_json() that could go wrong but we don't know about it yet. One step at a time.
This commit is contained in:
parent
6f992d784f
commit
905065f8c8
5 changed files with 8 additions and 12 deletions
|
@ -164,7 +164,7 @@ PerformanceEvent& PerformanceEventBuffer::at(size_t index)
|
|||
}
|
||||
|
||||
template<typename Serializer>
|
||||
bool PerformanceEventBuffer::to_json_impl(Serializer& object) const
|
||||
KResult PerformanceEventBuffer::to_json_impl(Serializer& object) const
|
||||
{
|
||||
{
|
||||
auto strings = object.add_array("strings");
|
||||
|
@ -263,10 +263,10 @@ bool PerformanceEventBuffer::to_json_impl(Serializer& object) const
|
|||
}
|
||||
array.finish();
|
||||
object.finish();
|
||||
return true;
|
||||
return KSuccess;
|
||||
}
|
||||
|
||||
bool PerformanceEventBuffer::to_json(KBufferBuilder& builder) const
|
||||
KResult PerformanceEventBuffer::to_json(KBufferBuilder& builder) const
|
||||
{
|
||||
JsonObjectSerializer object(builder);
|
||||
return to_json_impl(object);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue