bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* [PATCH] dfa: remove unused the member of structure
@ 2020-09-26  1:07 Norihiro Tanaka
  2020-09-26  2:22 ` Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Norihiro Tanaka @ 2020-09-26  1:07 UTC (permalink / raw
  To: bug-grep; +Cc: bug-gnulib

[-- Attachment #1: Type: text/plain, Size: 95 bytes --]

Hi,

Now the member 'first_end' in struct dfa is used.
It should be removed.

Thanks,
Norihiro

[-- Attachment #2: 0001-dfa-remove-unused-the-member-of-structure.patch --]
[-- Type: text/plain, Size: 1930 bytes --]

From ce3f6337b651128d405137a58656e623579cf17d Mon Sep 17 00:00:00 2001
From: Norihiro Tanaka <noritnk@kcn.ne.jp>
Date: Sat, 26 Sep 2020 09:50:01 +0900
Subject: [PATCH] dfa: remove unused the member of structure

* lib/dfa.c (struct dfa): Remove unused member 'first_end'.
---
 lib/dfa.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/lib/dfa.c b/lib/dfa.c
index 4df5b00..74aafa2 100644
--- a/lib/dfa.c
+++ b/lib/dfa.c
@@ -370,7 +370,6 @@ typedef struct
   position_set elems;           /* Positions this state could match.  */
   unsigned char context;        /* Context from previous state.  */
   unsigned short constraint;    /* Constraint for this state to accept.  */
-  token first_end;              /* Token value of the first END in elems.  */
   position_set mbps;            /* Positions which can match multibyte
                                    characters or the follows, e.g., period.
                                    Used only if MB_CUR_MAX > 1.  */
@@ -2229,7 +2228,6 @@ state_index (struct dfa *d, position_set const *s, int context)
   size_t hash = 0;
   int constraint = 0;
   state_num i;
-  token first_end = 0;
 
   for (i = 0; i < s->nelem; ++i)
     {
@@ -2282,8 +2280,6 @@ state_index (struct dfa *d, position_set const *s, int context)
         {
           if (succeeds_in_context (c, context, CTX_ANY))
             constraint |= c;
-          if (!first_end)
-            first_end = d->tokens[s->elems[j].index];
         }
       else if (d->tokens[s->elems[j].index] == BACKREF)
         constraint = NO_CONSTRAINT;
@@ -2298,7 +2294,6 @@ state_index (struct dfa *d, position_set const *s, int context)
   copy (s, &d->states[i].elems);
   d->states[i].context = context;
   d->states[i].constraint = constraint;
-  d->states[i].first_end = first_end;
   d->states[i].mbps.nelem = 0;
   d->states[i].mbps.elems = NULL;
   d->states[i].mb_trindex = -1;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dfa: remove unused the member of structure
  2020-09-26  1:07 [PATCH] dfa: remove unused the member of structure Norihiro Tanaka
@ 2020-09-26  2:22 ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2020-09-26  2:22 UTC (permalink / raw
  To: Norihiro Tanaka; +Cc: bug-grep, bug-gnulib

Thanks. That patch is obviously harmless even at this late stage of grep 
testing, so I installed it into Gnulib where it can be picked up by the next 
gnulib update in grep.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-26  2:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-26  1:07 [PATCH] dfa: remove unused the member of structure Norihiro Tanaka
2020-09-26  2:22 ` Paul Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).