(encoder, store, idset)
| 148 | * @function |
| 149 | */ |
| 150 | export const writeStructsFromIdSet = (encoder, store, idset) => { |
| 151 | // write # states that were updated |
| 152 | encoding.writeVarUint(encoder.restEncoder, idset.clients.size) |
| 153 | // Write items with higher client ids first |
| 154 | // This heavily improves the conflict algorithm. |
| 155 | array.from(idset.clients.entries()).sort((a, b) => b[0] - a[0]).forEach(([client, ids]) => { |
| 156 | const idRanges = ids.getIds() |
| 157 | const structs = /** @type {Array<GC|Item>} */ (store.clients.get(client)) |
| 158 | writeStructs(encoder, structs, client, idRanges) |
| 159 | }) |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * Resume computing structs generated by struct readers. |
no test coverage detected
searching dependent graphs…