-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Conversation
runtime/src/accounts_index.rs
Outdated
@@ -7,6 +7,8 @@ use std::{ | |||
|
|||
pub type SlotList<T> = Vec<(Slot, T)>; | |||
pub type SlotSlice<'s, T> = &'s [(Slot, T)]; | |||
pub type AncestorList = HashMap<Slot, usize>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've chosen this naming to align with those preceding type aliases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I've selected ???List
because I wanted to introduce some thin abstraction from the underlying types (SlotList
from Vec
; AncestorList
from HashMap
) for the case that we switch the container types in the future for implmentation changes.
I know ???List
is a bit ambiguous to std::collections::LinkedList
, but ???Collection
or ???Container
is too long to type...
Anyway, this is not my strong opinion. :)
Codecov Report
@@ Coverage Diff @@
## master #9699 +/- ##
========================================
- Coverage 80.5% 80.5% -0.1%
========================================
Files 279 279
Lines 63933 63933
========================================
- Hits 51523 51518 -5
- Misses 12410 12415 +5 |
@sakridge Could you review this when you have some free time? :) |
It's not a List (aka Vec). For the abstraction you're looking for, how about calling it |
* Introduce type alias AncestorList * Rename AncestorList => Ancestors (cherry picked from commit 9918539)
* Introduce type alias AncestorList * Rename AncestorList => Ancestors (cherry picked from commit 9918539) # Conflicts: # accounts-bench/src/main.rs # runtime/src/accounts_db.rs # runtime/src/accounts_index.rs
context: trying backporting for #9527 |
define a type alias for fewer line breaks and slightly-improved readability. :)
spin-off of #9527; too tired of looking eye-sore
fn
signatures for newly defined methods in that pr...no functional change