[gnome-photos/wip/rishi/buffer-decoder: 2/13] build: Remove redundant if branch



commit bb70945f6590b08e277fddbfc58f53bc2814e394
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Sep 25 07:51:32 2018 +0200

    build: Remove redundant if branch
    
    Meson's 'find_program' function [1] aborts the build by default if the
    program can't be found, unless the keyword argument 'required' is set
    to 'false'. Therefore, there's no need to check the '.found()' on the
    returned object before proceeding.
    
    [1] http://mesonbuild.com/Reference-manual.html#find_program
    
    https://gitlab.gnome.org/GNOME/gnome-photos/merge_requests/58

 meson.build | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/meson.build b/meson.build
index b51e3200..cb41c8ef 100644
--- a/meson.build
+++ b/meson.build
@@ -39,11 +39,9 @@ config_h.set_quoted('PACKAGE_URL', 'https://wiki.gnome.org/Apps/Photos')
 config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
 
 git = find_program('git')
-if git.found()
-  res = run_command(git, '-C', source_root, 'describe')
-  if res.returncode() == 0
-    config_h.set_quoted('PACKAGE_COMMIT_ID', res.stdout().strip())
-  endif
+res = run_command(git, '-C', source_root, 'describe')
+if res.returncode() == 0
+  config_h.set_quoted('PACKAGE_COMMIT_ID', res.stdout().strip())
 endif
 
 config_h.set_quoted('G_LOG_DOMAIN', meson.project_name())


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