Re: [PATCH v2] last-modified: implement faster algorithm
From: Toon Claes <hidden>
Date: 2025-10-29 13:02:10
From: Toon Claes <hidden>
Date: 2025-10-29 13:02:10
Taylor Blau [off-list ref] writes:
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