mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2026-02-09 03:06:42 +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;
|
bool finish() noexcept;
|
||||||
span<char> buffer(std::size_t sz) noexcept;
|
span<char> buffer(std::size_t sz) noexcept;
|
||||||
void expend(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.
|
/// \brief Supports custom fmt_to methods for imp::fmt.
|
||||||
|
|||||||
@ -196,7 +196,7 @@ void fmt_context::expend(std::size_t sz) noexcept {
|
|||||||
offset_ += sz;
|
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());
|
auto sbuf = buffer(str.size());
|
||||||
if (sbuf.size() < str.size()) {
|
if (sbuf.size() < str.size()) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user