FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 07-08-2011, 04:31 AM
DJ Mills
 
Default Remove pre-optimization from in_array()

The '[[ -z' test in in_array() doesn't really do anything, so I'm
removing it. I think this is much cleaner.

Signed-off-by: DJ Mills <danielmills1@gmail.com>
---
scripts/makepkg.sh.in | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 1b132a9..e215c4b 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -318,10 +318,8 @@ in_opt_array() {
# 1 - not found
##
in_array() {
- local needle=$1; shift
- [[ -z $1 ]] && return 1 # Not Found
- local item
- for item in "$@"; do
+ local needle=$1 item; shift
+ for item; do
[[ $item = $needle ]] && return 0 # Found
done
return 1 # Not Found
--
1.7.6
 

Thread Tools




All times are GMT. The time now is 02:23 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org