Skip to content

feat(known-key): add OwnedValue & OwnedObject lookup support to KnownKey - #470

Open
Aditya-9-6 wants to merge 1 commit into
simd-lite:mainfrom
Aditya-9-6:feat/known-key-owned-support
Open

feat(known-key): add OwnedValue & OwnedObject lookup support to KnownKey#470
Aditya-9-6 wants to merge 1 commit into
simd-lite:mainfrom
Aditya-9-6:feat/known-key-owned-support

Conversation

@Aditya-9-6

Copy link
Copy Markdown

Summary

Currently, KnownKey provides fast O(1) hashed key lookup methods (lookup, map_lookup, lookup_mut, map_lookup_mut) exclusively for BorrowedValue and BorrowedObject.

This PR adds complete support for OwnedValue and OwnedObject to KnownKey, allowing applications using owned DOM representations to benefit from pre-computed hash lookups without re-hashing key strings.

Proposed Changes

  • KnownKey::lookup_owned: Fast O(1) lookup on &OwnedValue.
  • KnownKey::map_lookup_owned: Fast O(1) lookup on &owned::Object.
  • KnownKey::lookup_owned_mut: Mutable O(1) lookup on &mut OwnedValue.
  • KnownKey::map_lookup_owned_mut: Mutable O(1) lookup on &mut owned::Object.
  • Unit Tests: Added test_known_key_owned() in src/known_key.rs.

Verification

  • cargo test --features known-key: All unit tests, integration tests, and doc-tests passed cleanly.
  • cargo clippy --features known-key: Passed with 0 warnings/errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant