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

[PATCH 08/28] remove conditional return

From
DRDavid Rientjes <rientjes@google.com>
Date
Aug 14, 2006, 20:25 UTC
Message-ID
<Pine.LNX.4.63.0608141324490.19383@chino.corp.google.com>
Removes conditional return from builtin-pack-objects.c
		David
Signed-off-by: David Rientjes <rientjes@google.com>
---
 builtin-pack-objects.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 2f99212..eb287a2 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -138,12 +138,7 @@ static int cmp_offset(const void *a_, co
 {
 	unsigned long a = *(unsigned long *) a_;
 	unsigned long b = *(unsigned long *) b_;
-	if (a < b)
-		return -1;
-	else if (a == b)
-		return 0;
-	else
-		return 1;
+	return (a < b) ? -1 : !(a == b);
 }
 
 /*
-- 
1.4.2.g89bb-dirty
Message 1 of 1 in “remove conditional return”
  1. 08/28 remove conditional returnDavid Rientjes, Aug 14, 2006

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.