I am not 100% certain, but this may be an unnecessary query to the database. When quoting from a locked thread, the limit is set to zero, so no rows will be returned in the query, but the query will still run.
You're right that a maximally-performant implementation would definitely omit the query entirely. Even a query like "
SELECT 1;" is slower than just about anything done
within PHP, since a network request introduces a (relative) ton of latency.
However, I would consider it a slightly
worse patch if it fixed this because it would increase the code complexity a fair bit, and the only benefit would be saving a few milliseconds on a page that will probably only be accessed a handful of times each day. In fact, if I'd implemented this, I probably would've left the query as-is, since that would've only used a few additional miliseconds.