Browse Source

Hoist fetch out of loop

master
cancel 6 years ago
parent
commit
243568958f
  1. 3
      tui_main.c

3
tui_main.c

@ -466,6 +466,7 @@ void draw_glyphs_grid(WINDOW* win, int draw_y, int draw_x, int draw_h,
if (rows == 0 || cols == 0) if (rows == 0 || cols == 0)
return; return;
bool use_rulers = ruler_spacing_y != 0 && ruler_spacing_x != 0; bool use_rulers = ruler_spacing_y != 0 && ruler_spacing_x != 0;
chtype bullet = ACS_BULLET;
for (Usz iy = 0; iy < rows; ++iy) { for (Usz iy = 0; iy < rows; ++iy) {
Usz line_offset = (offset_y + iy) * field_w + offset_x; Usz line_offset = (offset_y + iy) * field_w + offset_x;
Glyph const* g_row = gbuffer + line_offset; Glyph const* g_row = gbuffer + line_offset;
@ -479,7 +480,7 @@ void draw_glyphs_grid(WINDOW* win, int draw_y, int draw_x, int draw_h,
if (use_y_ruler && (ix + offset_x) % ruler_spacing_x == 0) if (use_y_ruler && (ix + offset_x) % ruler_spacing_x == 0)
ch = '+'; ch = '+';
else else
ch = ACS_BULLET; ch = bullet;
} else { } else {
ch = (chtype)g; ch = (chtype)g;
} }

Loading…
Cancel
Save