is this the most elegant solution to the problem? no.
but is it the fastest, best optimized solution? also no.
this is a purely vibes-based solution. did I write unit tests or run the fuzzer? no, because it passes the vibe check.
ask yourself, will this PR fix the bug? maybe. probably. but will it improve the feel of the codebase? absolutely.