summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Mendez <jmendeth@gmail.com>2014-04-09 13:18:07 +0200
committerXavier Mendez <jmendeth@gmail.com>2014-04-09 13:18:07 +0200
commitf62c5a79bb47acaa3084e3ccda6ddc0fbf616024 (patch)
treeeced44189e2588a40b165cee2401e1329a65fcf3
parent4d4cac23130f7c3b0c63e423cf6c03af80a4b47f (diff)
downloadrust-hoedown-f62c5a79bb47acaa3084e3ccda6ddc0fbf616024.tar.gz
Remove wrong grow()s in escape
They assume the buffer is empty, which is wrong. Even if they took that into account, these small grows are useless most of the time (the unit is big).
-rw-r--r--src/escape.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/escape.c b/src/escape.c
index b1039ed..749eb75 100644
--- a/src/escape.c
+++ b/src/escape.c
@@ -4,8 +4,6 @@
#include <stdio.h>
#include <string.h>
-#define ESCAPE_GROW_FACTOR(x) (((x) * 12) / 10) /* this is very scientific, yes */
-
/*
* The following characters will not be escaped:
*
@@ -71,7 +69,6 @@ hoedown_escape_href(hoedown_buffer *ob, const uint8_t *src, size_t size)
return;
}
- hoedown_buffer_grow(ob, ESCAPE_GROW_FACTOR(size));
}
hoedown_buffer_put(ob, src + org, i - org);
@@ -173,7 +170,6 @@ hoedown_escape_html(hoedown_buffer *ob, const uint8_t *src, size_t size, int sec
return;
}
- hoedown_buffer_grow(ob, ESCAPE_GROW_FACTOR(size));
}
hoedown_buffer_put(ob, src + org, i - org);