perf completion: Strip function_exists ()
authorRamkumar Ramachandra <artagnon@gmail.com>
Thu, 4 Jul 2013 12:41:29 +0000 (18:11 +0530)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 9 Oct 2013 14:12:06 +0000 (11:12 -0300)
Use "type" to check existence consistently.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1372941691-14684-6-git-send-email-artagnon@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/bash_completion

index d2598be..35fdda1 100644 (file)
@@ -1,12 +1,6 @@
 # perf completion
 
-function_exists()
-{
-       declare -F $1 > /dev/null
-       return $?
-}
-
-function_exists __ltrim_colon_completions ||
+type __ltrim_colon_completions &>/dev/null ||
 __ltrim_colon_completions()
 {
        if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then