[gnome-photos/gnome-3-30] build: Remove redundant if branch
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/gnome-3-30] build: Remove redundant if branch
- Date: Mon, 1 Oct 2018 13:46:08 +0000 (UTC)
commit 5dd930d955ce45c7ef2d7cbdb96b1cbab93daac5
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.
Fallout from cc5584327aacd6590ff69eeb5a130c41843ce3c8
[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 cca1119e..b6193c76 100644
--- a/meson.build
+++ b/meson.build
@@ -38,11 +38,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]