Commit graph

6 commits

Author SHA1 Message Date
overlookmotel
cc57541281 refactor(data_structures): NonEmptyStack::len hint that len is never 0 (#6220)
Tiny optimization. Make sure compiler knows that `NonEmptyStack::len` can never return 0.
2024-10-01 14:58:36 +00:00
overlookmotel
147a5d50fd refactor(data_structures): remove is_empty methods for non-empty stacks (#6219)
Remove `SparseStack::is_empty` method. It's pointless as the stack is never empty.

Add a dummy `NonEmptyStack::is_empty` method that always returns `false`. This is also pointless, but it overrides `slice::is_empty` which is otherwise accessible via `Deref`.
2024-10-01 14:58:35 +00:00
overlookmotel
61805fd3f2 refactor(data_structures): add debug assertion to SparseStack (#6218)
Just add an additional debug assert.
2024-10-01 12:26:38 +00:00
overlookmotel
7566c2d66f feat(data_structures): add as_slice + as_mut_slice methods to stacks (#6216)
Add `as_slice` and `as_mut_slice` methods to `Stack` and `NonEmptyStack`.
2024-10-01 12:26:36 +00:00
overlookmotel
dbfa0bc01f refactor(data_structures): add len method to StackCommon trait (#6215)
`len` method is in common between all stack types. Move it into `StackCommon` trait.
2024-10-01 12:26:35 +00:00
Boshen
c3c3447ac3 feat(data_structures): add oxc_data_structures crate; add stack (#6206) 2024-10-01 10:02:45 +00:00