From 039913a8fe92b0f07b4bee418bc4df0ed85c7811 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 28 Dec 2015 10:35:28 -0800 Subject: Small optimization in _scan_at. If the input is null, we can just return 0. --- src/scanners.re | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/scanners.re b/src/scanners.re index 00a0b12..befe7d0 100644 --- a/src/scanners.re +++ b/src/scanners.re @@ -6,10 +6,9 @@ bufsize_t _scan_at(bufsize_t (*scanner)(const unsigned char *), cmark_chunk *c, { bufsize_t res; unsigned char *ptr = (unsigned char *)c->data; - unsigned char zero = '\0'; if (ptr == NULL) { - res = scanner(&zero); + return 0; } else { unsigned char lim = ptr[c->len]; -- cgit v1.2.3