grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep branch, master, updated. v2.18-138-ga474c78


From: Paul Eggert
Subject: grep branch, master, updated. v2.18-138-ga474c78
Date: Fri, 09 May 2014 21:49:33 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  a474c789e9dcc4fc21c89311140017b0826abfad (commit)
       via  523e085b6a0e6b8d19e912011dd62b15c05a14d7 (commit)
      from  a0951492eb630fb26e33f02f440a24305db33b51 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=a474c789e9dcc4fc21c89311140017b0826abfad


commit a474c789e9dcc4fc21c89311140017b0826abfad
Author: Paul Eggert <address@hidden>
Date:   Fri May 9 14:48:47 2014 -0700

    grep: minor improvements to retry-DFA-superset patch
    
    * src/dfasearch.c (EGexecute): Avoid unnecessary test in a context
    where memrchr cannot return a null pointer.

diff --git a/src/dfasearch.c b/src/dfasearch.c
index 9fb7449..77b4e3e 100644
--- a/src/dfasearch.c
+++ b/src/dfasearch.c
@@ -284,23 +284,18 @@ EGexecute (char const *buf, size_t size, size_t 
*match_size,
           /* Try matching with the superset of DFA, if it's defined.  */
           if (superset && !exact_kwset_match)
             {
-              while (true)
+              /* Keep using the superset while it reports multiline
+                 potential matches; this is more likely to be fast
+                 than falling back to KWset would be.  */
+              while ((next_beg = dfaexec (superset, dfa_beg, (char *) end, 1,
+                                          &count, NULL))
+                     && next_beg != end
+                     && count != 0)
                 {
-                  next_beg = dfaexec (superset, dfa_beg, (char *) end, 1,
-                                      &count, NULL);
-                  /* If there's no match, or if we've matched the sentinel,
-                     we're done.  */
-                  if (next_beg == NULL || next_beg == end)
-                    break;
-
-                  if (count == 0)
-                    break;
+                  /* Try to match in just one line.  */
                   count = 0;
-
-                  /* If dfaexec may match in multiple lines, try to
-                     match in one line.  */
                   beg = memrchr (buf, eol, next_beg - buf);
-                  beg = beg ? beg + 1 : buf;
+                  beg++;
                   dfa_beg = beg;
                 }
               if (next_beg == NULL || next_beg == end)
@@ -310,6 +305,7 @@ EGexecute (char const *buf, size_t size, size_t *match_size,
               end = memchr (next_beg, eol, buflim - next_beg);
               end = end ? end + 1 : buflim;
             }
+
           /* Try matching with DFA.  */
           next_beg = dfaexec (dfa, dfa_beg, (char *) end, 0, &count, &backref);
 

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=523e085b6a0e6b8d19e912011dd62b15c05a14d7


commit a474c789e9dcc4fc21c89311140017b0826abfad
Author: Paul Eggert <address@hidden>
Date:   Fri May 9 14:48:47 2014 -0700

    grep: minor improvements to retry-DFA-superset patch
    
    * src/dfasearch.c (EGexecute): Avoid unnecessary test in a context
    where memrchr cannot return a null pointer.

diff --git a/src/dfasearch.c b/src/dfasearch.c
index 9fb7449..77b4e3e 100644
--- a/src/dfasearch.c
+++ b/src/dfasearch.c
@@ -284,23 +284,18 @@ EGexecute (char const *buf, size_t size, size_t 
*match_size,
           /* Try matching with the superset of DFA, if it's defined.  */
           if (superset && !exact_kwset_match)
             {
-              while (true)
+              /* Keep using the superset while it reports multiline
+                 potential matches; this is more likely to be fast
+                 than falling back to KWset would be.  */
+              while ((next_beg = dfaexec (superset, dfa_beg, (char *) end, 1,
+                                          &count, NULL))
+                     && next_beg != end
+                     && count != 0)
                 {
-                  next_beg = dfaexec (superset, dfa_beg, (char *) end, 1,
-                                      &count, NULL);
-                  /* If there's no match, or if we've matched the sentinel,
-                     we're done.  */
-                  if (next_beg == NULL || next_beg == end)
-                    break;
-
-                  if (count == 0)
-                    break;
+                  /* Try to match in just one line.  */
                   count = 0;
-
-                  /* If dfaexec may match in multiple lines, try to
-                     match in one line.  */
                   beg = memrchr (buf, eol, next_beg - buf);
-                  beg = beg ? beg + 1 : buf;
+                  beg++;
                   dfa_beg = beg;
                 }
               if (next_beg == NULL || next_beg == end)
@@ -310,6 +305,7 @@ EGexecute (char const *buf, size_t size, size_t *match_size,
               end = memchr (next_beg, eol, buflim - next_beg);
               end = end ? end + 1 : buflim;
             }
+
           /* Try matching with DFA.  */
           next_beg = dfaexec (dfa, dfa_beg, (char *) end, 0, &count, &backref);
 

-----------------------------------------------------------------------

Summary of changes:
 src/dfasearch.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]