Reduce fragility of memo handling #check-lint-warning
Reduce fragility by reducing the number of literal array indices. Also makes the code slightly more readable in some cases by naming fields.
Spurred by a comment on !2713 (merged). Will move out of draft status when that branch lands and this one is updated to cover it.
Edited by Asmund THORSec