mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-07 09:16:46 +08:00
upd: [imp] a little optimization of fmt
This commit is contained in:
parent
3c1fec6058
commit
1014baf821
@ -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.
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user