* Returns a rotor entry by given name. * @protected * @param {string} name Rotor name * @return {?object} Rotor entry or null if not found.
(name)
| 951 | * @return {?object} Rotor entry or null if not found. |
| 952 | */ |
| 953 | static getRotor (name) { |
| 954 | if (rotorMap === null) { |
| 955 | // Read rotor table and build map lazily |
| 956 | rotorMap = {} |
| 957 | let i, j, rotor |
| 958 | for (i = 0; i < rotorTable.length; i += rotorTableColumns.length) { |
| 959 | rotor = {} |
| 960 | for (j = 0; j < rotorTableColumns.length; j++) { |
| 961 | rotor[rotorTableColumns[j]] = rotorTable[i + j] |
| 962 | } |
| 963 | rotorMap[rotor.name] = rotor |
| 964 | } |
| 965 | } |
| 966 | return rotorMap[name] || null |
| 967 | } |
| 968 | |
| 969 | /** |
| 970 | * Maps given names to rotor entries. |
no outgoing calls
no test coverage detected