-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
Type/Improvementin progressCurrently being implementedCurrently being implementedsemtypeRelates to types moduleRelates to types module
Description
Description:
$subject.
We need to refactor as follows.
- Use constant for the indexes.
- Define an array of atoms and loop over it to initialize. e.g.
final readonly & Atom[] PREDEFINED_ATOMS = [ ...]; - Can be accessed as follows:
PREDEFINED_ATOMS[CELL_ATOM_TOP_INDEX];
Related code segment:
nballerina/compiler/modules/types/core.bal
Lines 1286 to 1293 in 941f899
| final Atom CELL_ATOM_TOP = { index: 0, atomicType: CELL_ATOMIC_TOP }; | |
| final Atom CELL_ATOM_BOTTOM = { index: 1, atomicType: CELL_ATOMIC_BOTTOM }; | |
| final Atom CELL_ATOM_MAPPING_TOP = { index: 2, atomicType: CELL_ATOMIC_MAPPING_TOP }; | |
| final Atom LIST_ATOM_MAPPING_TOP = { index: 3, atomicType: LIST_ATOMIC_MAPPING_TOP }; | |
| final Atom CELL_ATOM_RO = { index: 4, atomicType: CELL_ATOMIC_RO }; | |
| final Atom MAPPING_ATOM_RO = { index: 5, atomicType: MAPPING_ATOMIC_RO }; | |
| final Atom CELL_ATOM_MAPPING_RO = { index: 6, atomicType: CELL_ATOMIC_MAPPING_RO }; | |
| final Atom LIST_ATOM_MAPPING_RO = { index: 7, atomicType: LIST_ATOMIC_MAPPING_RO }; |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type/Improvementin progressCurrently being implementedCurrently being implementedsemtypeRelates to types moduleRelates to types module