diff options
author | Russell Belfer <arrbee@arrbee.com> | 2012-03-25 23:04:26 -0700 |
---|---|---|
committer | Russell Belfer <arrbee@arrbee.com> | 2012-03-25 23:04:26 -0700 |
commit | 1db12b00532d747fa7a805a8fa8d293c58ec16d9 (patch) | |
tree | c7fd3bc4e6b27ab35c0ca7162274452deee53410 /src/diff.h | |
parent | 875bfc5ffcdd21fca616d4f88444d4dcf6fd69ac (diff) | |
download | libgit2-1db12b00532d747fa7a805a8fa8d293c58ec16d9.tar.gz |
Eliminate hairy COITERATE macro
I decided that the COITERATE macro was, in the end causing
more confusion that it would save and decided just to write
out the loops that I needed for parallel diff list iteration.
It is not that much code and this just feels less obfuscated.
Diffstat (limited to 'src/diff.h')
-rw-r--r-- | src/diff.h | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/diff.h b/src/diff.h index 058a1f5e8..7d69199ea 100644 --- a/src/diff.h +++ b/src/diff.h @@ -21,19 +21,5 @@ struct git_diff_list { git_iterator_type_t new_src; }; -/* macro lets you iterate over two diff lists together */ - -#define GIT_DIFF_COITERATE(A,B,AD,BD,LEFT,RIGHT,BOTH,AFTER) do { \ - unsigned int _i = 0, _j = 0; int _cmp; \ - while (((A) && _i < (A)->deltas.length) || ((B) && _j < (B)->deltas.length)) { \ - (AD) = (A) ? GIT_VECTOR_GET(&(A)->deltas,_i) : NULL; \ - (BD) = (B) ? GIT_VECTOR_GET(&(B)->deltas,_j) : NULL; \ - _cmp = !(BD) ? -1 : !(AD) ? 1 : strcmp((AD)->old.path,(BD)->old.path); \ - if (_cmp < 0) { LEFT; _i++; } \ - else if (_cmp > 0) { RIGHT; _j++; } \ - else { BOTH; _i++; _j++; } \ - AFTER; \ - } } while (0) - #endif |