Skip to content

Commit

Permalink
api/ext_tabline: memset() instead of for-loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmk committed Apr 26, 2017
1 parent 8db9e44 commit 5f88224
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/nvim/api/ui.c
Expand Up @@ -94,9 +94,7 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height,
ui->set_icon = remote_ui_set_icon;
ui->event = remote_ui_event;

for (UIWidget i = 0; i < UI_WIDGETS; i++) {
ui->ui_ext[i] = false;
}
memset(ui->ui_ext, false, UI_WIDGETS * sizeof(ui->ui_ext[0]));

for (size_t i = 0; i < options.size; i++) {
ui_set_option(ui, options.items[i].key, options.items[i].value, err);
Expand Down
4 changes: 1 addition & 3 deletions src/nvim/tui/tui.c
Expand Up @@ -135,9 +135,7 @@ UI *tui_start(void)
ui->set_icon = tui_set_icon;
ui->event = tui_event;

for (UIWidget i = 0; i < UI_WIDGETS; i++) {
ui->ui_ext[i] = false;
}
memset(ui->ui_ext, false, UI_WIDGETS * sizeof(ui->ui_ext[0]));

return ui_bridge_attach(ui, tui_main, tui_scheduler);
}
Expand Down

0 comments on commit 5f88224

Please sign in to comment.