1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:28:11 +00:00

Kernel: Convert all *Builder::appendf() => appendff()

This commit is contained in:
Andreas Kling 2021-02-09 16:08:43 +01:00
parent 764af6cdec
commit 1f277f0bd9
8 changed files with 12 additions and 34 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -24,10 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <AK/PrintfImplementation.h>
#include <AK/StdLibExtras.h>
#include <Kernel/KBufferBuilder.h>
#include <stdarg.h>
namespace Kernel {
@ -113,22 +111,6 @@ void KBufferBuilder::append(char ch)
m_size += 1;
}
void KBufferBuilder::appendvf(const char* fmt, va_list ap)
{
printf_internal([this](char*&, char ch) {
append(ch);
},
nullptr, fmt, ap);
}
void KBufferBuilder::appendf(const char* fmt, ...)
{
va_list ap;
va_start(ap, fmt);
appendvf(fmt, ap);
va_end(ap);
}
void KBufferBuilder::append_escaped_for_json(const StringView& string)
{
for (auto ch : string) {