aboutsummaryrefslogtreecommitdiff
path: root/src/librc/librc-depend.c
diff options
context:
space:
mode:
authorChristian Ruppert <idl0r@gentoo.org>2012-04-26 12:40:13 +0200
committerChristian Ruppert <idl0r@gentoo.org>2012-04-26 12:40:13 +0200
commit441272ff97b2dec4c3566239acf501c88f3026c8 (patch)
tree4929cfee51bd3c682e1560654ecccb3dc85d9ee8 /src/librc/librc-depend.c
parentfd6bbfbe0713b07d050f0318610ebd479735c661 (diff)
Reduce overhead by leaving rc_deptree_update_needed() as soon as possible
There's no need to check any further if we're returning true anyway. Signed-off-by: Christian Ruppert <idl0r@gentoo.org>
Diffstat (limited to 'src/librc/librc-depend.c')
-rw-r--r--src/librc/librc-depend.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/librc/librc-depend.c b/src/librc/librc-depend.c
index 3aa94575..5e99c1b0 100644
--- a/src/librc/librc-depend.c
+++ b/src/librc/librc-depend.c
@@ -687,27 +687,27 @@ rc_deptree_update_needed(time_t *newest, char *file)
if (!existss(RC_DEPTREE_CACHE))
return true;
if (!rc_newer_than(RC_DEPTREE_CACHE, RC_INITDIR, newest, file))
- newer = true;
+ return true;
if (!rc_newer_than(RC_DEPTREE_CACHE, RC_CONFDIR, newest, file))
- newer = true;
+ return true;
#ifdef RC_PKG_INITDIR
if (!rc_newer_than(RC_DEPTREE_CACHE, RC_PKG_INITDIR, newest, file))
- newer = true;
+ return true;
#endif
#ifdef RC_PKG_CONFDIR
if (!rc_newer_than(RC_DEPTREE_CACHE, RC_PKG_CONFDIR, newest, file))
- newer = true;
+ return true;
#endif
#ifdef RC_LOCAL_INITDIR
if (!rc_newer_than(RC_DEPTREE_CACHE, RC_LOCAL_INITDIR, newest, file))
- newer = true;
+ return true;
#endif
#ifdef RC_LOCAL_CONFDIR
if (!rc_newer_than(RC_DEPTREE_CACHE, RC_LOCAL_CONFDIR, newest, file))
- newer = true;
+ return true;
#endif
if (!rc_newer_than(RC_DEPTREE_CACHE, RC_CONF, newest, file))
- newer = true;
+ return true;
/* Some init scripts dependencies change depending on config files
* outside of baselayout, like syslog-ng, so we check those too. */
@@ -715,8 +715,7 @@ rc_deptree_update_needed(time_t *newest, char *file)
TAILQ_FOREACH(s, config, entries) {
if (!rc_newer_than(RC_DEPTREE_CACHE, s->value, newest, file)) {
newer = true;
- if (newest == NULL)
- break;
+ break;
}
}
rc_stringlist_free(config);