Skip to content

Commit

Permalink
Fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
dcreager committed Feb 27, 2025
1 parent 1cdb11d commit ec15919
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions crates/ruff_index/src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@
//! like a linked list; and looking up an element by key is also O(n), since you must do a linear
//! scan of the list to find the matching element. The typical implementation also suffers from
//! poor cache locality and high memory allocation overhead, since individual list cells are
//! typically allocated separately from the heap.
//!
//! We solve that last problem by storing the cells of an association list in an [`IndexVec`]
//! arena. You provide the index type (`I`) that you want to use with this arena. That means that
//! an individual association list is represented by an `Option<I>`, with `None` representing an
//! empty list.
//! typically allocated separately from the heap. We solve that last problem by storing the cells
//! of an association list in an [`IndexVec`] arena.
//!
//! We exploit structural sharing where possible, reusing cells across multiple lists when we can.
//! That said, we don't guarantee that lists are canonical — it's entirely possible for two lists
Expand Down

0 comments on commit ec15919

Please sign in to comment.