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

[PATCH] Remove redundant double exclamation points

From
RGRose via GitGitGadget <gitgitgadget@gmail.com>
Date
Dec 19, 2022, 14:12 UTC
Message-ID
<pull.1401.git.git.1671459163559.gitgitgadget@gmail.com>
From: Seija Kijin <doremylover123@gmail.com>
S_ISDIR is a macro that involves a "==" comparison.
This means the !! is redundant and not needed.
Signed-off-by: Seija Kijin <doremylover123@gmail.com>
---
    Remove redundant double exclamation points
    
    S_ISDIR is a macro that involves a "==" comparison.
    
    This means the !! is redundant and not needed.
    
    Signed-off-by: Seija Kijin doremylover123@gmail.com
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1401%2FAtariDreams%2FIS_DIR-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1401/AtariDreams/IS_DIR-v1
Pull-Request: https://github.com/git/git/pull/1401
 tree-walk.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/tree-walk.c b/tree-walk.c
index 74f4d710e8f..6b51d27ccb2 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -1040,9 +1040,9 @@ static enum interesting do_match(struct index_state *istate,
 		    ps->max_depth == -1)
 			return all_entries_interesting;
 		return within_depth(base->buf + base_offset, baselen,
-				    !!S_ISDIR(entry->mode),
-				    ps->max_depth) ?
-			entry_interesting : entry_not_interesting;
+				    S_ISDIR(entry->mode), ps->max_depth) ?
+			       entry_interesting :
+			       entry_not_interesting;
 	}
 
 	pathlen = tree_entry_len(entry);
@@ -1073,8 +1073,7 @@ static enum interesting do_match(struct index_state *istate,
 
 			if (within_depth(base_str + matchlen + 1,
 					 baselen - matchlen - 1,
-					 !!S_ISDIR(entry->mode),
-					 ps->max_depth))
+					 S_ISDIR(entry->mode), ps->max_depth))
 				goto interesting;
 			else
 				return entry_not_interesting;

base-commit: 7c2ef319c52c4997256f5807564523dfd4acdfc7
-- 
gitgitgadget
Next: Ævar Arnfjörð Bjarmason
Message 1 of 3 in “Remove redundant double exclamation points”
  1. Remove redundant double exclamation pointsRose via GitGitGadget, Dec 19, 2022
  2. Ævar Arnfjörð BjarmasonDec 19, 2022
  3. Junio C HamanoDec 20, 2022

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.