]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
df: omit redundant comparison
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 27 Jul 2018 19:00:02 +0000 (12:00 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 27 Jul 2018 19:03:52 +0000 (12:03 -0700)
Trivial inefficiency reported by Bruno Haible in:
http://lists.gnu.org/r/bug-gnulib/2018-07/msg00109.html
* src/df.c (hide_problematic_chars): Omit redundant test.

src/df.c

index 9b6587273187acce0b7ce7ebd59ac3d39a5c524e..55532219f3e7732ca971699ee24378134f7af050 100644 (file)
--- a/src/df.c
+++ b/src/df.c
@@ -288,7 +288,7 @@ hide_problematic_chars (char *cell)
       wchar_t wc;
       size_t srcbytes = srcend - src;
       n = mbrtowc (&wc, src, srcbytes, &mbstate);
-      bool ok = 0 < n && n <= srcbytes;
+      bool ok = n <= srcbytes;
 
       if (ok)
         ok = !iswcntrl (wc);