From de242255dcb7a5d7c7ffa858608e52380d5e3dcf Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Tue, 23 Jan 2018 20:08:30 +0200 Subject: [PATCH] (edit_do_search): use gboolean. Remove unused computations. Signed-off-by: Andrew V. Samoilov --- src/editor/editcmd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c index a0734ee58..ab0758db2 100644 --- a/src/editor/editcmd.c +++ b/src/editor/editcmd.c @@ -962,7 +962,7 @@ edit_do_search (WEdit * edit) if (search_create_bookmark) { - int found = 0, books = 0; + gboolean found = FALSE; long l = 0, l_last = -1; long q = 0; @@ -971,20 +971,19 @@ edit_do_search (WEdit * edit) while (mc_search_run (edit->search, (void *) &esm, q, edit->buffer.size, &len)) { - if (found == 0) + if (!found) edit->search_start = edit->search->normal_offset; - found++; + found = TRUE; l += edit_buffer_count_lines (&edit->buffer, q, edit->search->normal_offset); if (l != l_last) { book_mark_insert (edit, l, BOOK_MARK_FOUND_COLOR); - books++; } l_last = l; q = edit->search->normal_offset + 1; } - if (found == 0) + if (!found) edit_error_dialog (_("Search"), _(STR_E_NOTFOUND)); else edit_cursor_move (edit, edit->search_start - edit->buffer.curs1);