commit 2b21d53857c3f3f76a77c29cf5cf0c6a973731be
parent cddfcb1b9d14855c12f265ff4aaa22d64cc7189e
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 21 Mar 2019 17:36:46 +0100
tweaks: elide a function that is called just once
Diffstat:
1 file changed, 9 insertions(+), 16 deletions(-)
diff --git a/src/chars.c b/src/chars.c
@@ -636,20 +636,8 @@ char *mbrevstrpbrk(const char *head, const char *accept, const char *pointer)
#endif /* !NANO_TINY */
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || defined(ENABLE_JUSTIFY))
-/* Return TRUE if the string s contains one or more blank characters,
+/* Return TRUE if the given string contains at least one blank character,
* and FALSE otherwise. */
-bool has_blank_chars(const char *s)
-{
- for (; *s != '\0'; s++) {
- if (isblank((unsigned char)*s))
- return TRUE;
- }
-
- return FALSE;
-}
-
-/* Return TRUE if the multibyte string s contains one or more blank
- * multibyte characters, and FALSE otherwise. */
bool has_blank_mbchars(const char *s)
{
#ifdef ENABLE_UTF8
@@ -662,11 +650,16 @@ bool has_blank_mbchars(const char *s)
if (is_blank_mbchar(symbol))
return TRUE;
}
-
- return FALSE;
} else
#endif
- return has_blank_chars(s);
+ {
+ for (; *s != '\0'; s++) {
+ if (isblank((unsigned char)*s))
+ return TRUE;
+ }
+ }
+
+ return FALSE;
}
#endif /* ENABLE_NANORC && (!NANO_TINY || ENABLE_JUSTIFY) */