git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[GSOC][PATCH] Fixed an issue which contained extra unnecessary code

From
Ssushmaunnibhavi <sushmaunnibhavi425@gmail.com>
Date
Mar 10, 2019, 14:31 UTC
Message-ID
<20190310143126.GA13588@hacker-queen>
From 5a6c233c6bf0a35aca000b32b9e936a34532900a Mon Sep 17 00:00:00 2001
From: sushmaunnibhavi <sushmaunnibhavi@gmail.com>
Date: Sun, 10 Mar 2019 19:37:33 +0530
Subject: [GSOC][PATCH] Fixed an issue which contained extra unnecessary code
Signed-off-by: Sushma Unnibhavi <sushmaunnibhavi425@gmail.com>
---
Since '\n' and '\0' are char_len==1,it is not necessary to check if the char_len<=1.
 compat/regex/regexec.c | 5 -----
 1 file changed, 5 deletions(-)
diff --git a/compat/regex/regexec.c b/compat/regex/regexec.c
index 1b5d89fd5e..df62597531 100644
--- a/compat/regex/regexec.c
+++ b/compat/regex/regexec.c
@@ -3799,11 +3799,6 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
   char_len = re_string_char_size_at (input, str_idx);
   if (node->type == OP_PERIOD)
     {
-      if (char_len <= 1)
-	return 0;
-      /* FIXME: I don't think this if is needed, as both '\n'
-	 and '\0' are char_len == 1.  */
-      /* '.' accepts any one character except the following two cases.  */
       if ((!(dfa->syntax & RE_DOT_NEWLINE) &&
 	   re_string_byte_at (input, str_idx) == '\n') ||
 	  ((dfa->syntax & RE_DOT_NOT_NULL) &&
-- 
2.17.1
Next: Christian Couder
Message 1 of 3 in “Fixed an issue which contained extra unnecessary code”
  1. sushmaunnibhaviMar 10, 2019
  2. Christian CouderMar 10, 2019
  3. Thomas GummererMar 10, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.