| 5500 | // rename took 18 s). |
| 5501 | const candidates = new Set<number>(); |
| 5502 | const idsWhere = (column: 'source' | 'target', nodeIds: string[]): void => { |
| 5503 | for (let i = 0; i < nodeIds.length; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 5504 | const chunk = nodeIds.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |
| 5505 | const rows = this.db |
| 5506 | .prepare(`SELECT id FROM edges WHERE ${column} IN (${chunk.map(() => '?').join(',')})`) |
| 5507 | .all(...chunk) as Array<{ id: number }>; |
| 5508 | for (const r of rows) candidates.add(r.id); |
| 5509 | } |
| 5510 | }; |
| 5511 | // Edges into the affected module files. |
| 5512 | for (let i = 0; i < targetFiles.length; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 5513 | const chunk = targetFiles.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |