mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 10:41:58 +02:00
Cleanup loop exit condition
This commit is contained in:
@@ -1109,9 +1109,9 @@ load_hb_buffer(CPUCell *first_cpu_cell, GPUCell *first_gpu_cell, index_type num_
|
|||||||
for (num = 0; num_cells; first_cpu_cell++, first_gpu_cell++, num_cells--) {
|
for (num = 0; num_cells; first_cpu_cell++, first_gpu_cell++, num_cells--) {
|
||||||
text_in_cell(first_cpu_cell, tc, lc);
|
text_in_cell(first_cpu_cell, tc, lc);
|
||||||
if (first_cpu_cell->is_multicell && first_cpu_cell->x) continue;
|
if (first_cpu_cell->is_multicell && first_cpu_cell->x) continue;
|
||||||
if (lc->count + num > arraysz(shape_buffer)) break;
|
const size_t count = MIN(lc->count, arraysz(shape_buffer) - num);
|
||||||
memcpy(shape_buffer + num, lc->chars, lc->count * sizeof(shape_buffer[0]));
|
memcpy(shape_buffer + num, lc->chars, count * sizeof(shape_buffer[0]));
|
||||||
num += lc->count;
|
num += count;
|
||||||
}
|
}
|
||||||
hb_buffer_add_utf32(harfbuzz_buffer, shape_buffer, num, 0, num);
|
hb_buffer_add_utf32(harfbuzz_buffer, shape_buffer, num, 0, num);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user