Commit d9f62df
show_dirstat: simplify same-content check
We use two nested conditionals to store a content_changed
variable, but only bother to look at the result once,
directly after we set it. We can drop the variable entirely
and just use a single "if".
This needless complexity is the result of 2ff3a80 (Teach
--dirstat not to completely ignore rearranged lines within a
file, 2011-04-11). Before that, we held onto the
content_changed variable much longer.
While we're touching the condition, we can swap out oidcmp()
for !oideq(). Our coccinelle patches didn't previously find
this case because of the intermediate variable, but now it's
a simple boolean in a conditional.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 6a29d7b commit d9f62df
1 file changed
+3
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2933 | 2933 | | |
2934 | 2934 | | |
2935 | 2935 | | |
2936 | | - | |
2937 | 2936 | | |
2938 | 2937 | | |
2939 | 2938 | | |
2940 | | - | |
2941 | | - | |
2942 | | - | |
2943 | | - | |
2944 | | - | |
2945 | | - | |
| 2939 | + | |
| 2940 | + | |
2946 | 2941 | | |
2947 | 2942 | | |
2948 | 2943 | | |
| |||
2989 | 2984 | | |
2990 | 2985 | | |
2991 | 2986 | | |
2992 | | - | |
| 2987 | + | |
2993 | 2988 | | |
2994 | 2989 | | |
2995 | 2990 | | |
| |||
0 commit comments