gumbo-parser/src/string_buffer.c in nokogumbo-1.4.1 vs gumbo-parser/src/string_buffer.c in nokogumbo-1.4.2
- old
+ new
@@ -24,13 +24,11 @@
#include "string_piece.h"
#include "util.h"
struct GumboInternalParser;
-// Size chosen via statistical analysis of ~60K websites.
-// 99% of text nodes and 98% of attribute names/values fit in this initial size.
-static const size_t kDefaultStringBufferSize = 5;
+static const size_t kDefaultStringBufferSize = 10;
static void maybe_resize_string_buffer(
struct GumboInternalParser* parser, size_t additional_chars,
GumboStringBuffer* buffer) {
size_t new_length = buffer->length + additional_chars;
@@ -98,14 +96,9 @@
struct GumboInternalParser* parser, GumboStringBuffer* input) {
char* buffer = gumbo_parser_allocate(parser, input->length + 1);
memcpy(buffer, input->data, input->length);
buffer[input->length] = '\0';
return buffer;
-}
-
-void gumbo_string_buffer_clear(
- struct GumboInternalParser* parser, GumboStringBuffer* input) {
- input->length = 0;
}
void gumbo_string_buffer_destroy(
struct GumboInternalParser* parser, GumboStringBuffer* buffer) {
gumbo_parser_deallocate(parser, buffer->data);