monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Review of diff-p branch


From: Zack Weinberg
Subject: Re: [Monotone-devel] Review of diff-p branch
Date: Tue, 11 Jul 2006 14:48:22 -0700

On 7/11/06, Nathaniel Smith <address@hidden> wrote:
+/* Find, and write to ENCLOSER, the nearest line before POS which
matches
+ ENCLOSER_PATTERN.  We remember the last line scanned, and the
matched, to
+   avoid duplication of effort.  */
...
^^ I think I'd feel more comfortable here with some I()'s scattered
around here?  It is Clever, and involves Pointers, you see.

Not really pointers, just iterators and a lot of complicated
vector-index arithmetic, but
see attached; maybe it's clearer?

...
The way the unidiff and context diff writers go back and parse
their own output seems a bit... well, odd, anyway?

The requirement is to pass find_encloser() an index which is one less
than the first changed line (+, -, or !) in the hunk; this is not
always a_begin+ctx, as a previous version tried.  I could have the
writers keep track of which line this is, but honestly it seemed
clearer to me to do it this way.

zw

Attachment: better-find-encloser.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]