Re: [PATCH v2 4/9] object: add clear_commit_marks_all()
- From
Jeff King <peff@peff.net>
- Date
- Jan 10, 2018, 07:58 UTC
- Message-ID
- <20180110075838.GD16315@sigill.intra.peff.net>
- In-Reply-To
- <ec45f9a8-292a-53e2-52b6-44d744cb6c36@web.de>
On Mon, Dec 25, 2017 at 06:44:58PM +0100, René Scharfe wrote:
> Add a function for clearing the commit marks of all in-core commit > objects. It's similar to clear_object_flags(), but more precise, since > it leaves the other object types alone. It still has to iterate through > them, though.
Makes sense.
Is it worth having:
void clear_object_flags_from_type(int type, unsigned flags);
rather than having two near-identical functions? I guess we'd need some way of saying "all types" to reimplement clear_object_flags() as a wrapper (OBJ_NONE, I guess?).
The run-time check is maybe a little bit slower in the middle of a tight loop, but I'm not sure it would matter much (I'd actually be curious if this approach is faster than the existing traversal code, too).
-Peff