Subject: bug#16729: closed (Re: suggested small refactoring in dfa.c)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 01 Mar 2014 06:57:04 +0000

Your bug report

#16729: suggested small refactoring in dfa.c

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
16729: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16729
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: suggested small refactoring in dfa.c
From: Paul Eggert <[email-masked]>
To: [email-masked]
Date: Fri, 28 Feb 2014 22:56:49 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

My recent changes to dfa.c have incorporated the removal of that "if 
(0)" and have refactored the rest so I'm marking this bug as done.

Subject: suggested small refactoring in dfa.c
From: [email-masked]
To: [email-masked]
Date: Wed, 12 Feb 2014 06:58:53 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Jim, Paul.

Here is the small refactoring I suggest for dfa.c

Thanks,

Arnold
--------------------
diff --git a/dfa.c b/dfa.c
index d5e7fdf..dcd28e5 100644
--- a/dfa.c
+++ b/dfa.c
@@ -1767,18 +1767,19 @@ add_utf8_anychar (void)
 static void
 atom (void)
 {
-  if (0)
+  if (MBS_SUPPORT && tok == WCHAR)
     {
-      /* empty */
-    }
-  else if (MBS_SUPPORT && tok == WCHAR)
-    {
-      addtok_wc (case_fold ? towlower (wctok) : wctok);
-      if (case_fold && iswalpha (wctok))
-        {
-          addtok_wc (towupper (wctok));
-          addtok (OR);
-        }
+      if (! case_fold)
+        addtok_wc (wctok);
+      else
+      {
+        addtok_wc (towlower (wctok));
+        if (iswalpha (wctok))
+          {
+            addtok_wc (towupper (wctok));
+            addtok (OR);
+          }
+      }
 
       tok = lex ();
     }