Re: [PATCH v2] last-modified: implement faster algorithm
- From
Toon Claes <toon@iotcl.com>
- Date
- Oct 29, 2025, 13:01 UTC
- Message-ID
- <87ldktrhe1.fsf@iotcl.com>
- In-Reply-To
- <aP/Gdl0kGJWklZdO@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
Show 8 quoted lines
> I am not saying that we should continue to write "if (0 <= k)", since we > will clearly never take the else branch. I am trying to say that > path_idx() *could* return (size_t)-1, and callers would be able to write > "if (k == (size_t)-1)" to check for that error condition. > > My observation was that there are unlikely to be so many active paths at > any one time such that we'd ever want to return (size_t)-1 as a valid > index, and could always use it as an error sentinel.
Yes, I agree. If the list grows to (size_t)-1 entries, I think we also run into other issues.
Anyhow, in the v3 I've submitted, I resolved it differently so no awkward type cast is needed.
-- Cheers, Toon