diff options
author | 2014-04-25 14:10:59 +0000 | |
---|---|---|
committer | 2014-04-25 14:10:59 +0000 | |
commit | 9f85492fd9661579c137fdf3db1a8a2a648dd0d3 (patch) | |
tree | 9a75d3951cb0666ff245a3408a56f69dd3440fbc /usr.bin/mandoc/mdoc.c | |
parent | Fold in the zlib_cleanup macro. (diff) | |
download | wireguard-openbsd-9f85492fd9661579c137fdf3db1a8a2a648dd0d3.tar.xz wireguard-openbsd-9f85492fd9661579c137fdf3db1a8a2a648dd0d3.zip |
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!
Diffstat (limited to 'usr.bin/mandoc/mdoc.c')
-rw-r--r-- | usr.bin/mandoc/mdoc.c | 4 |
1 files 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 <kristaps@bsd.lv> * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -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, |