(apply_translations): Use toupper rather than
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 9 Jul 2006 17:01:38 +0000 (17:01 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 9 Jul 2006 17:01:38 +0000 (17:01 +0000)
islower followed by toupper; it's simpler and typically
faster now that we assume at least C89 semantics.  Similarly
for tolower.

src/dd.c

index 9dc8244..276ed74 100644 (file)
--- a/src/dd.c
+++ b/src/dd.c
@@ -977,15 +977,13 @@ apply_translations (void)
   if (conversions_mask & C_UCASE)
     {
       for (i = 0; i < 256; i++)
-       if (ISLOWER (trans_table[i]))
-         trans_table[i] = TOUPPER (trans_table[i]);
+       trans_table[i] = toupper (trans_table[i]);
       translation_needed = true;
     }
   else if (conversions_mask & C_LCASE)
     {
       for (i = 0; i < 256; i++)
-       if (ISUPPER (trans_table[i]))
-         trans_table[i] = TOLOWER (trans_table[i]);
+       trans_table[i] = tolower (trans_table[i]);
       translation_needed = true;
     }