From: "Christian Ruppert" <idl0r@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:gentoolkit-dev commit in: src/echangelog/
Date: Sat, 8 Nov 2014 17:48:11 +0000 (UTC) [thread overview]
Message-ID: <1415468883.e57ed600e070e5cbfbd57086f7497cfd8ca480d9.idl0r@gentoo> (raw)
commit: e57ed600e070e5cbfbd57086f7497cfd8ca480d9
Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 4 14:42:47 2014 +0000
Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
CommitDate: Sat Nov 8 17:48:03 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=e57ed600
echangelog: get rid of useless hash calls down to only one
---
src/echangelog/echangelog | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/echangelog/echangelog b/src/echangelog/echangelog
index 7f5e307..adf3ac8 100755
--- a/src/echangelog/echangelog
+++ b/src/echangelog/echangelog
@@ -108,17 +108,19 @@ sub version {
exit 0;
}
-sub getenv($) {
+sub getenv ($) {
my $key = shift;
- # Ensure our variable exist
- if ( defined($ENV{$key}) ) {
- # Ensure we don't get empty variables
- if ( length($ENV{$key}) > 0 ) {
- return $ENV{$key};
- }
- }
- return;
+ # Check for key: defined and not empty
+ return if !$key or $key eq '';
+
+ # Fetch key in %ENV hash
+ my $env = $ENV{$key};
+
+ # Make sure the variable does exist,
+ # check for its length
+ # and return it
+ return $env if $env and (length($env) > 0);
}
# Bug 264146.
next reply other threads:[~2014-11-08 17:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-08 17:48 Christian Ruppert [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-03-19 23:10 [gentoo-commits] proj/gentoolkit:gentoolkit-dev commit in: src/echangelog/ Mike Gilbert
2014-11-15 18:37 Christian Ruppert
2013-05-11 19:22 Christian Ruppert
2013-05-11 19:11 Christian Ruppert
2013-05-11 18:59 Christian Ruppert
2013-05-11 18:50 Christian Ruppert
2013-05-11 18:50 Christian Ruppert
2013-05-11 14:18 Christian Ruppert
2013-05-10 22:47 Christian Ruppert
2012-04-09 15:48 Christian Ruppert
2012-04-09 14:13 Christian Ruppert
2011-02-25 20:51 Christian Ruppert
2011-02-25 20:51 Christian Ruppert
2011-02-25 20:51 Christian Ruppert
2011-02-25 20:51 Christian Ruppert
2011-02-25 20:51 Christian Ruppert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1415468883.e57ed600e070e5cbfbd57086f7497cfd8ca480d9.idl0r@gentoo \
--to=idl0r@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox