tag/Handler: pass StringView to OnTag() and OnPair()
Eliminates a number of allocations, because callers don't need to copy the strings to a newly allocated buffer only to null-terminate them. And most callers don't need to have a null-terminated string.
This commit is contained in:
@@ -25,11 +25,15 @@
|
||||
enum TagType : uint8_t;
|
||||
|
||||
struct Tag;
|
||||
struct StringView;
|
||||
class Response;
|
||||
|
||||
void
|
||||
tag_print_types(Response &response) noexcept;
|
||||
|
||||
void
|
||||
tag_print(Response &response, TagType type, StringView value) noexcept;
|
||||
|
||||
void
|
||||
tag_print(Response &response, TagType type, const char *value) noexcept;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user