Thread (77 messages) 77 messages, 3 authors, 2021-04-12
STALE1919d
Revisions (2)
  1. v1 current
  2. v1 [diff vs current]

[PATCH 03/25] grep/pcre2: drop needless assignment to NULL

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-02-03 03:29:15
Subsystem: the rest · Maintainer: Linus Torvalds

Remove a redundant assignment of pcre2_compile_context dating back to
my 94da9193a6e (grep: add support for PCRE v2, 2017-06-01). In
create_grep_pat() we xcalloc() the "grep_pat" struct, so there's no
need to NULL out individual members here.

I think this was probably something left over from an earlier
development version of mine.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 grep.c | 2 --
 1 file changed, 2 deletions(-)
diff --git a/grep.c b/grep.c
index 816e23f17e..f27c5de7f5 100644
--- a/grep.c
+++ b/grep.c
@@ -373,8 +373,6 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt
 	int patinforet;
 	size_t jitsizearg;
 
-	p->pcre2_compile_context = NULL;
-
 	/* pcre2_global_context is initialized in append_grep_pattern */
 	if (opt->ignore_case) {
 		if (!opt->ignore_locale && has_non_ascii(p->pattern)) {
-- 
2.30.0.284.gd98b1dd5eaa7
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help