open-webui/backend/open_webui/retrieval
Classic298 f73f09a3e0
refac: drop the redundant .keys() from two dict membership tests (#28859)
`x in d` and `x in d.keys()` are identical for a plain dict, so the `.keys()` call builds a throwaway view and reads as if it were doing something. Both sites operate on a plain dict: `combined` in `merge_and_sort_query_results` is a local `dict()`, and `ui_settings` comes from `UserSettings.model_dump()` where `ui` is annotated `dict | None` and is already guarded against None on the preceding line.

No behaviour change, and no measurable speedup either, so this is a readability cleanup rather than a performance one.

Sites where `.keys()` is load-bearing are left alone: the `list(d.keys())` snapshots taken before mutating during iteration, and the places where `.keys()` is the iteration or comprehension source rather than a membership test.
2026-08-23 16:02:09 -04:00
..
loaders refactor: remove the unreachable async half of the Mistral loader and an unused Datalab helper (#28839) 2026-08-20 13:14:14 -07:00
models fix: repair two broken logging calls, one of which makes VECTOR_DB=opengauss unusable (#27838) 2026-08-10 22:19:41 -06:00
vector fix: repair two broken logging calls, one of which makes VECTOR_DB=opengauss unusable (#27838) 2026-08-10 22:19:41 -06:00
web refac: remove unreachable rate limit handler from DuckDuckGo web search (#28943) 2026-08-23 12:59:05 -04:00
external.py refac 2026-07-27 01:59:17 -04:00
utils.py refac: drop the redundant .keys() from two dict membership tests (#28859) 2026-08-23 16:02:09 -04:00