commit 446c7d5fff6e55c487ed3069345de75ec4027aa4
parent 52efac535b33019215f0c0942c420c14ac658b04
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 21 May 2018 21:19:47 +0200
tweaks: elide a function that is called just once
Diffstat:
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/text.c b/src/text.c
@@ -1985,14 +1985,6 @@ bool quotes_match(const char *a_line, size_t a_quote, const char *b_line)
strncmp(a_line, b_line, a_quote) == 0);
}
-/* We assume a_line and b_line have no quote part. Then, we return
- * whether b_line could follow a_line in a paragraph. */
-bool indents_match(const char *a_line, size_t a_indent, const char
- *b_line, size_t b_indent)
-{
- return (a_indent == b_indent && strncmp(a_line, b_line, b_indent) == 0);
-}
-
/* Return TRUE when the given line is the beginning of a paragraph (BOP). */
bool begpar(const filestruct *const line)
{
@@ -2022,8 +2014,8 @@ bool begpar(const filestruct *const line)
/* If the indentation of the preceding line equals the indentation
* of this line, this is not a BOP. */
- if (indents_match(line->prev->data + quote_len, prev_dent_len,
- line->data + quote_len, indent_len))
+ if (prev_dent_len == indent_len && strncmp(line->prev->data + quote_len,
+ line->data + quote_len, indent_len) == 0)
return FALSE;
/* Otherwise, this is a BOP if the preceding line is not. */