Skip to content
This repository was archived by the owner on Jul 2, 2019. It is now read-only.

Commit cbfe47b

Browse files
peffgitster
authored andcommitted
diff_filespec: use only 2 bits for is_binary flag
The is_binary flag needs only three values: -1, 0, and 1. However, we use a whole 32-bit int for it on most systems (both 32- and 64- bit). Instead, we can mark it to use only 2 bits. On 32-bit systems, this lets it end up as part of the bitfield above (saving 4 bytes). On 64-bit systems, we don't see any change (because the savings end up as padding), but it does leave room for another "free" 32-bit value to be added later. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b38f70a commit cbfe47b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

diffcore.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct diff_filespec {
4646
unsigned is_stdin : 1;
4747
unsigned has_more_entries : 1; /* only appear in combined diff */
4848
/* data should be considered "binary"; -1 means "don't know yet" */
49-
int is_binary;
49+
int is_binary : 2;
5050
struct userdiff_driver *driver;
5151
};
5252

0 commit comments

Comments
 (0)