On Mon, Dec 11, 2023 at 10:08 AM Patrick Steinhardt <ps@xxxxxx> wrote: > > This initially caught me by surprise, but on closer inspection I agree > > that this is OK, since stack_filename() calls strbuf_reset() before > > adjusting the buffer contents. > > > > (As a side-note, I do find the side-effect of stack_filename() to be a > > little surprising, but that's not the fault of this series and not worth > > changing here.) > > Agreed, I also found this to be a bit confusing at first. I'll amend the > commit message with "Note that we do not have to manually reset the > buffer because `stack_filename()` does this for us already." to help > future readers. In C++ it is expected that assignment operators clear the destination before executing the assignment, so it depends on your expectations. If this is confusing, maybe another name is in order? -- Han-Wen Nienhuys - hanwenn@xxxxxxxxx - http://www.xs4all.nl/~hanwen