From 41fadeffe7bd61eca618e263a046e3a9014eeacc Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 18 Feb 2024 12:39:50 +0300 Subject: [PATCH] (check_panel_timestamp): constify arguments, simplify checks. Signed-off-by: Andrew Borodin --- src/filemanager/filemanager.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/filemanager/filemanager.c b/src/filemanager/filemanager.c index 1250dad09..484ae1d39 100644 --- a/src/filemanager/filemanager.c +++ b/src/filemanager/filemanager.c @@ -460,21 +460,11 @@ toggle_panels_split (void) #ifdef ENABLE_VFS /* event helper */ static gboolean -check_panel_timestamp (const WPanel * panel, panel_view_mode_t mode, struct vfs_class *vclass, - vfsid id) +check_panel_timestamp (const WPanel * panel, panel_view_mode_t mode, const struct vfs_class *vclass, + const vfsid id) { - if (mode == view_listing) - { - const struct vfs_class *me; - - me = vfs_path_get_last_path_vfs (panel->cwd_vpath); - if (me != vclass) - return FALSE; - - if (vfs_getid (panel->cwd_vpath) != id) - return FALSE; - } - return TRUE; + return (mode != view_listing || (vfs_path_get_last_path_vfs (panel->cwd_vpath) == vclass + && vfs_getid (panel->cwd_vpath) == id)); } /* --------------------------------------------------------------------------------------------- */