mirror of
https://github.com/bitwarden/browser
synced 2026-02-08 20:50:28 +00:00
Implements a reverse index (autofillFieldsByOpid) to enable O(1) lookups by opid instead of iterating through all cached elements. Key changes: - Add autofillFieldsByOpid Map for direct opid → element lookups - Update getAutofillFieldElementByOpid to use dual-index with stale check - Maintain both indices in cacheAutofillFieldElement - Clean up both indices in clear and delete operations Performance: Eliminates O(n) array iteration on every opid lookup.