cmark

My personal build of CMark ✏️

Commit
039913a8fe92b0f07b4bee418bc4df0ed85c7811
Parent
ac73c7827650675f4bfe28fdef2a355b9950f2dc
Author
John MacFarlane <jgm@berkeley.edu>
Date

Small optimization in _scan_at.

If the input is null, we can just return 0.

Diffstat

1 file changed, 1 insertion, 2 deletions

Status File Name N° Changes Insertions Deletions
Modified src/scanners.re 3 1 2
diff --git 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];