Revision: 1473
http://vcs.pcre.org/viewvc?view=rev&revision=1473
Author: ph10
Date: 2014-04-21 18:52:38 +0100 (Mon, 21 Apr 2014)
Log Message:
-----------
Tidy code by merging two identical branches.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/pcre_exec.c
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2014-04-21 16:11:50 UTC (rev 1472)
+++ code/trunk/ChangeLog 2014-04-21 17:52:38 UTC (rev 1473)
@@ -11,6 +11,9 @@
applied after reading the number, and stupidly assuming that integer
overflow would give a negative number. The tests are now applied as the
numbers are read.
+
+3. Tidy code in pcre_exec.c where two branches that used to be different are
+ now the same.
Version 8.35 04-April-2014
Modified: code/trunk/pcre_exec.c
===================================================================
--- code/trunk/pcre_exec.c 2014-04-21 16:11:50 UTC (rev 1472)
+++ code/trunk/pcre_exec.c 2014-04-21 17:52:38 UTC (rev 1473)
@@ -5681,54 +5681,25 @@
switch(ctype)
{
case OP_ANY:
- if (max < INT_MAX)
+ for (i = min; i < max; i++)
{
- for (i = min; i < max; i++)
+ if (eptr >= md->end_subject)
{
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (IS_NEWLINE(eptr)) break;
- if (md->partial != 0 && /* Take care with CRLF partial */
- eptr + 1 >= md->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- UCHAR21(eptr) == NLBLOCK->nl[0])
- {
- md->hitend = TRUE;
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
- }
- eptr++;
- ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++);
+ SCHECK_PARTIAL();
+ break;
}
- }
-
- /* Handle unlimited UTF-8 repeat */
-
- else
- {
- for (i = min; i < max; i++)
+ if (IS_NEWLINE(eptr)) break;
+ if (md->partial != 0 && /* Take care with CRLF partial */
+ eptr + 1 >= md->end_subject &&
+ NLBLOCK->nltype == NLTYPE_FIXED &&
+ NLBLOCK->nllen == 2 &&
+ UCHAR21(eptr) == NLBLOCK->nl[0])
{
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (IS_NEWLINE(eptr)) break;
- if (md->partial != 0 && /* Take care with CRLF partial */
- eptr + 1 >= md->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- UCHAR21(eptr) == NLBLOCK->nl[0])
- {
- md->hitend = TRUE;
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
- }
- eptr++;
- ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++);
+ md->hitend = TRUE;
+ if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
}
+ eptr++;
+ ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++);
}
break;