On Thu, Oct 20, 2022 at 11:11:32PM -0400, Taylor Blau wrote: > When there are no trailers to insert, it is natural that > insert_records_from_trailers() should return without having done any > work. > > But instead we guard this call unnecessarily by first checking whether > `log->groups` has the `SHORTLOG_GROUP_TRAILER` bit set. > > Prepare to match a similar pattern in the future where a function which > inserts records of a certain type does no work when no specifiers > matching that type are given. The patch looks good. And knowing what the rest of the series looks like, this is clearly the right thing to do. But I wonder if the rationale would be easier if it came at the end. Then rather than "prepare to match a similar pattern in the future", you can just say "it's weird that we check the bit for SHORTLOG_GROUP_TRAILER but nothing else; let's make them consistent". Obviously this is a minor nit, and I don't care much either way, as the end result is the same. I just think in general that "this is bad, let's make it better" makes commit messages easier to write than ones which posit some hypothetical future state. ;) -Peff