From 885b1b4f82385e06efaa5c60c49c9c7e8a1b7104 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 5 Nov 2010 15:53:01 +0300 Subject: [PATCH] Optimization: ret rid of select_item() call ...after go to the found file or directory. Signed-off-by: Andrew Borodin --- src/find.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/find.c b/src/find.c index 3f1d7059f..b0dcecc7f 100644 --- a/src/find.c +++ b/src/find.c @@ -1511,27 +1511,24 @@ do_find (void) if (v == B_ENTER) { - if (dirname || filename) + if (dirname != NULL) { - if (dirname) - { - do_cd (dirname, cd_exact); - if (filename) - try_to_select (current_panel, filename + (content ? - (strchr (filename + 4, ':') - - filename + 1) : 4)); - } - else if (filename) - do_cd (filename, cd_exact); - select_item (current_panel); + do_cd (dirname, cd_exact); + if (filename != NULL) + try_to_select (current_panel, + filename + (content != NULL + ? strchr (filename + 4, ':') - filename + 1 : 4)); } + else if (filename != NULL) + do_cd (filename, cd_exact); + g_free (dirname); g_free (filename); break; } g_free (content); - dir_and_file_set = dirname && filename; + dir_and_file_set = (dirname != NULL) && (filename != NULL); g_free (dirname); g_free (filename);