-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove 1 level of indirection via &Vec -> &[T]
Typically `&Vec<T>` isn't something you want when you need a read-only view over a Vec, because it adds another level of indirection: Vec already stores a pointer to heap-allocated buffer internally. Using slices `&[T]` removes such unnecessary level of indirection and is considered a cleaner design. It is cache friendlier and can be better optimized by the compiler (not that it should matter in this case).
- Loading branch information
1 parent
22d36a8
commit 00f0c24
Showing
2 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters