upd: [imp] a little optimization of fmt

This commit is contained in:
mutouyun 2023-05-27 16:29:05 +08:00
parent 3c1fec6058
commit 1014baf821
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ public:
bool finish() noexcept;
span<char> buffer(std::size_t sz) noexcept;
void expend(std::size_t sz) noexcept;
bool append(std::string const &str) noexcept;
bool append(span<char const> const &str) noexcept;
};
/// \brief Supports custom fmt_to methods for imp::fmt.

View File

@ -196,7 +196,7 @@ void fmt_context::expend(std::size_t sz) noexcept {
offset_ += sz;
}
bool fmt_context::append(std::string const &str) noexcept {
bool fmt_context::append(span<char const> const &str) noexcept {
auto sbuf = buffer(str.size());
if (sbuf.size() < str.size()) {
return false;