[pacman-dev] [PATCH 1/2] 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
Instead of using var=$(command || echo blah); if [[ $var = *"blah"* ]],
which IMO is a creative hack, but very unnecessary, simply use:
if ! var=$(command); then
This patch gets rid of the hack.
Signed-off-by: DJ Mills
On 08/07/11 14:31, DJ Mills wrote:
Instead of using var=$(command || echo blah); if [[ $var = *"blah"* ]], which IMO is a creative hack, but very unnecessary, simply use: if ! var=$(command); then
This patch gets rid of the hack.
Signed-off-by: DJ Mills
On my working branch with a changed commit message. Allan
On 08/07/11 14:31, DJ Mills wrote:
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
Pulled to my working branch. I kept the 'for item in "$@"' part as I find it less clear what is being looped when $@ is not specified.
participants (2)
-
Allan McRae
-
DJ Mills