From 9f85492fd9661579c137fdf3db1a8a2a648dd0d3 Mon Sep 17 00:00:00 2001 From: schwarze Date: Fri, 25 Apr 2014 14:10:59 +0000 Subject: [PATCH] Fix a minor optimization i broke in bsd.lv 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! --- usr.bin/mandoc/mdoc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c index c2d654488cb..f0d86ad3398 100644 --- a/usr.bin/mandoc/mdoc.c +++ b/usr.bin/mandoc/mdoc.c @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.103 2014/04/20 16:44:44 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.104 2014/04/25 14:10:59 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze @@ -861,7 +861,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.20.1