[gnome-commander] search: use MIN() for calculation of searchfile_data->len



commit 2bfc15fe829b91986bed6b51828bb9a5253e89ae
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Thu May 19 23:22:01 2011 +0200

    search: use MIN() for calculation of searchfile_data->len

 src/dialogs/gnome-cmd-search-dialog.cc |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-search-dialog.cc b/src/dialogs/gnome-cmd-search-dialog.cc
index 88f9bba..ad084c7 100755
--- a/src/dialogs/gnome-cmd-search-dialog.cc
+++ b/src/dialogs/gnome-cmd-search-dialog.cc
@@ -199,12 +199,7 @@ static gboolean read_search_file (SearchData *data, SearchFileData *searchfile_d
           searchfile_data->len = SEARCH_BUFFER_SIZE - 1;
     }
     else   // first time call of this function
-    {
-        if (f->info->size < (SEARCH_BUFFER_SIZE - 1))
-            searchfile_data->len = f->info->size;
-        else
-            searchfile_data->len = SEARCH_BUFFER_SIZE - 1;
-    }
+        searchfile_data->len = MIN (f->info->size, SEARCH_BUFFER_SIZE - 1);
 
     searchfile_data->result = gnome_vfs_seek (searchfile_data->handle, GNOME_VFS_SEEK_START, searchfile_data->offset);
     if (searchfile_data->result != GNOME_VFS_OK)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]