We don't need to parse the sections we don't index, so stop early. Saves few
instructions.
This commit is contained in:
parent
a1ee30a19f
commit
e108642273
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: makemandb.c,v 1.43 2016/10/03 13:53:39 abhinav Exp $ */
|
/* $NetBSD: makemandb.c,v 1.44 2016/10/03 16:11:11 abhinav Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>
|
* Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>
|
||||||
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
|
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__RCSID("$NetBSD: makemandb.c,v 1.43 2016/10/03 13:53:39 abhinav Exp $");
|
__RCSID("$NetBSD: makemandb.c,v 1.44 2016/10/03 16:11:11 abhinav Exp $");
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -1089,6 +1089,22 @@ pmdoc_Sh(const struct roff_node *n, mandb_rec *rec)
|
||||||
if (n == NULL)
|
if (n == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
switch (n->sec) {
|
||||||
|
case SEC_NAME:
|
||||||
|
case SEC_SYNOPSIS:
|
||||||
|
case SEC_EXAMPLES:
|
||||||
|
case SEC_STANDARDS:
|
||||||
|
case SEC_HISTORY:
|
||||||
|
case SEC_AUTHORS:
|
||||||
|
case SEC_BUGS:
|
||||||
|
/*
|
||||||
|
* We don't care about text from these sections
|
||||||
|
*/
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (n->type == ROFFT_BLOCK)
|
if (n->type == ROFFT_BLOCK)
|
||||||
mdoc_parse_Sh(n->body, rec);
|
mdoc_parse_Sh(n->body, rec);
|
||||||
}
|
}
|
||||||
|
@ -1175,14 +1191,6 @@ mdoc_parse_section(enum roff_sec sec, const char *string, mandb_rec *rec)
|
||||||
case SEC_ERRORS:
|
case SEC_ERRORS:
|
||||||
append(&rec->errors, string);
|
append(&rec->errors, string);
|
||||||
break;
|
break;
|
||||||
case SEC_NAME:
|
|
||||||
case SEC_SYNOPSIS:
|
|
||||||
case SEC_EXAMPLES:
|
|
||||||
case SEC_STANDARDS:
|
|
||||||
case SEC_HISTORY:
|
|
||||||
case SEC_AUTHORS:
|
|
||||||
case SEC_BUGS:
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
append(&rec->desc, string);
|
append(&rec->desc, string);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue