From cb0cad5782ca3480821fec99f17bd057d5278ffe Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 25 Apr 2014 14:11:30 +0000 Subject: [PATCH] Fix a minor optimization i broke in rev. 1.163 on August 20, 2010: Do not bother looking into the hash table when the length of the macro already tells us it's invalid. No functional change. Noticed by jsg@, thanks! --- mdoc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mdoc.c b/mdoc.c index 16877817..c56fad41 100644 --- a/mdoc.c +++ b/mdoc.c @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.213 2014/04/20 16:46:05 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.214 2014/04/25 14:11:30 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze @@ -865,7 +865,7 @@ mdoc_pmacro(struct mdoc *mdoc, int ln, char *buf, int offs) mac[i] = '\0'; - tok = (i > 1 || i < 4) ? mdoc_hash_find(mac) : MDOC_MAX; + tok = (i > 1 && i < 4) ? mdoc_hash_find(mac) : MDOC_MAX; if (MDOC_MAX == tok) { mandoc_vmsg(MANDOCERR_MACRO, mdoc->parse, -- 2.47.1