From: Shawn O. Pearce Date: Tue, 22 Apr 2008 23:15:15 GMT Subject: Re: mark parsing in fast-import Message-ID: <20080422231515.GJ29771@spearce.org> In-Reply-To: <20080422093942.GA3752@alea.gnuu.de> Jrg Sommer wrote: > > Another question: Is :0 a valid mark? In import_marks() is a check for > !mark, but I haven't seen it anywhere else. No, in fast-import ":0" is _not_ a valid mark. We burn the first entry in the marks table (always leaving it empty) as then we can use the idiom "!mark" to say "no mark was requested/given" and "mark" to say "mark was requested/given". Hence we do not need an extra flag to tell us either way. Given that a mark is just a pointer, and that extra flag would likely have been a global "static int have_mark" or some such it works out to be about the same amount of memory - 4 or 8 bytes. No big deal, and the code is probably easier to follow as a result. -- Shawn.