Thread (1 message) 1 message, 1 author, 2016-09-07

Re: [PATCHv4] diff.c: emit moved lines with a different color

From: Junio C Hamano <hidden>
Date: 2016-09-07 18:52:27

Ramsay Jones [off-list ref] writes:
quoted
+static int diff_line_moved_entry_cmp(const struct diff_line_moved_entry *a,
+				     const struct diff_line_moved_entry *b,
+				     const void *unused)
+{
+	return strcmp(a->line, b->line) &&
+	       a->hash_prev_line == b->hash_prev_line;
I doubt it would make much difference, but my knee-jerk reaction to
this was to suggest swapping the order of the expression, thus:

	return a->hash_prev_line == b->hash_prev_line &&
		strcmp(a->line, b->line);

... but perhaps it doesn't read quite so well, and probably wouldn't affect
performance much (except in strange edge cases), so it may not be worth it.
It would make very much sense to do so, as the final version will be
a lot more involved than a mere strcmp() to make "git diff -w" to
also work as expected with this new feature.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help