On Sat, Oct 9, 2010 at 5:19 PM, Daniel Shahaf <d...@daniel.shahaf.name> wrote: > Johan Corveleyn wrote on Sat, Oct 09, 2010 at 14:21:09 +0200: >> (side-note: I considered first doing suffix scanning, then prefix >> scanning, so I could reuse the buffers/pointers from diff_baton all >> the time, and still have everything pointing correctly after >> eliminating prefix/suffix. But that could give vastly different >> results in some cases, for instance when original file is entirely >> identical to both the prefix and the suffix of the modified file. So I >> decided it's best to stick with first prefix, then suffix). > > What Hyrum said. How common /is/ this case? And, anyway, in that case > both "everything was appended" and "everything was prepended" are > equally legitimate diffs.
Hm, I'm not sure about this one. I just wanted to try the maximum reasonably possible to keep the results identical to what they were. Using another buffer for suffix scanning didn't seem that big of a deal (only slight increase in memory use (2 chunks of 128K in current implementation)). I made that decision pretty early, before I knew of the other problem of suffix scanning, and the keep-50-suffix-lines compromise we decided upon. There may be more subtle cases than the one I described, I don't know. OTOH, now that we have the keep-50-suffix-lines, that may help also in this case. I'll have to think about that. Maybe I can give it a go, first suffix then prefix, and see if I can find real-life problems ... -- Johan