(buffer, table, offset)
| 80 | } |
| 81 | |
| 82 | function encodeTable(buffer, table, offset) { |
| 83 | const start = offset; |
| 84 | const unfinishedContainers = []; |
| 85 | offset = beginEncodingContainer(unfinishedContainers, buffer, table, offset); |
| 86 | while (unfinishedContainers.length > 0) { |
| 87 | const innermostContainer = unfinishedContainers.at(-1); |
| 88 | if (hasUnencodedEntries(innermostContainer)) { |
| 89 | offset = encodeNextEntry(unfinishedContainers, buffer, innermostContainer, offset); |
| 90 | } else { |
| 91 | finishEncodingContainer(unfinishedContainers, buffer, offset); |
| 92 | } |
| 93 | } |
| 94 | return offset - start; |
| 95 | } |
| 96 | |
| 97 | function beginEncodingContainer(unfinishedContainers, buffer, values, offset) { |
| 98 | checkSpace(buffer, offset, 4); |
no test coverage detected