]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext: Refactor.
authorBruno Haible <bruno@clisp.org>
Thu, 30 Nov 2023 07:31:27 +0000 (08:31 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 30 Nov 2023 10:40:20 +0000 (11:40 +0100)
* gettext-tools/src/xg-message.c (remember_a_message): Simplify: Don't cache
mp->do_syntax_check in a local variable.

gettext-tools/src/xg-message.c

index 082f32921797dc38f9e0378e8f6439bd32b336de..895127d3d1341b46898b97e97f63a3c522a829ab 100644 (file)
@@ -230,7 +230,6 @@ remember_a_message (message_list_ty *mlp, char *msgctxt, char *msgid,
                     refcounted_string_list_ty *comment, bool comment_is_utf8)
 {
   struct argument_range range;
-  enum is_syntax_check do_syntax_check[NSYNTAXCHECKS];
   message_ty *mp;
   size_t i;
 
@@ -253,8 +252,6 @@ remember_a_message (message_list_ty *mlp, char *msgctxt, char *msgid,
 
   range.min = -1;
   range.max = -1;
-  for (i = 0; i < NSYNTAXCHECKS; i++)
-    do_syntax_check[i] = undecided;
 
   if (!is_utf8)
     {
@@ -315,8 +312,6 @@ meta information, not the empty string.\n"));
       if (msgctxt != NULL)
         free (msgctxt);
       free (msgid);
-      for (i = 0; i < NSYNTAXCHECKS; i++)
-        do_syntax_check[i] = mp->do_syntax_check[i];
     }
   else
     {
@@ -430,7 +425,7 @@ meta information, not the empty string.\n"));
             for (i = 0; i < NSYNTAXCHECKS; i++)
               if (tmp_syntax_check[i] != undecided)
                 {
-                  do_syntax_check[i] = tmp_syntax_check[i];
+                  mp->do_syntax_check[i] = tmp_syntax_check[i];
                   interesting = true;
                 }
 
@@ -498,8 +493,6 @@ meta information, not the empty string.\n"));
 
   decide_do_wrap (mp);
 
-  for (i = 0; i < NSYNTAXCHECKS; i++)
-    mp->do_syntax_check[i] = do_syntax_check[i];
   decide_syntax_check (mp);
 
   /* Warn about the use of non-reorderable format strings when the programming