Skip to content

Commit 5be4431

Browse files
committed
Removed redundand code
1 parent 54ebebd commit 5be4431

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

ext/pcre/php_pcre.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,6 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su
15351535
uint32_t options; /* Execution options */
15361536
int count; /* Count of matched subpatterns */
15371537
PCRE2_SIZE *offsets; /* Array of subpattern offsets */
1538-
char **subpat_names; /* Array for named subpatterns */
15391538
uint32_t num_subpats; /* Number of captured subpatterns */
15401539
size_t new_len; /* Length of needed storage */
15411540
size_t alloc_len; /* Actual allocated length */
@@ -1554,19 +1553,6 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su
15541553

15551554
/* Calculate the size of the offsets array, and allocate memory for it. */
15561555
num_subpats = pce->capture_count + 1;
1557-
1558-
/*
1559-
* Build a mapping from subpattern numbers to their names. We will
1560-
* allocate the table only if there are any named subpatterns.
1561-
*/
1562-
subpat_names = NULL;
1563-
if (UNEXPECTED(pce->name_count > 0)) {
1564-
subpat_names = make_subpats_table(num_subpats, pce);
1565-
if (!subpat_names) {
1566-
return NULL;
1567-
}
1568-
}
1569-
15701556
alloc_len = 0;
15711557
result = NULL;
15721558

@@ -1582,9 +1568,6 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su
15821568
match_data = pcre2_match_data_create_from_pattern(pce->re, gctx);
15831569
if (!match_data) {
15841570
PCRE_G(error_code) = PHP_PCRE_INTERNAL_ERROR;
1585-
if (subpat_names) {
1586-
efree(subpat_names);
1587-
}
15881571
return NULL;
15891572
}
15901573
}
@@ -1785,10 +1768,6 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su
17851768
pcre2_match_data_free(match_data);
17861769
}
17871770

1788-
if (UNEXPECTED(subpat_names)) {
1789-
efree(subpat_names);
1790-
}
1791-
17921771
return result;
17931772
}
17941773
/* }}} */

0 commit comments

Comments
 (0)