* Count the number of bindings in the given `opCodes`. * * It could be possible to speed this up, by passing the number of bindings found back from * `generateBindingUpdateOpCodes()` to `i18nAttributesFirstPass()` but this would then require more * complexity in the code and/or transient objects
(opCodes: I18nUpdateOpCodes)
| 475 | * contain multiple i18n bound attributes, it seems like this is a reasonable compromise. |
| 476 | */ |
| 477 | function countBindings(opCodes: I18nUpdateOpCodes): number { |
| 478 | let count = 0; |
| 479 | for (let i = 0; i < opCodes.length; i++) { |
| 480 | const opCode = opCodes[i]; |
| 481 | // Bindings are negative numbers. |
| 482 | if (typeof opCode === 'number' && opCode < 0) { |
| 483 | count++; |
| 484 | } |
| 485 | } |
| 486 | return count; |
| 487 | } |
| 488 | |
| 489 | /** |
| 490 | * Convert binding index to mask bit. |
no outgoing calls
no test coverage detected
searching dependent graphs…