diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-02-04 11:04:34 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-02-04 11:04:34 -0800 |
commit | 4311b83716b52b47969e4523128c77131c4da87e (patch) | |
tree | 6a8ecc7286487776cb19f9865428f4e201ecfca1 | |
parent | fc8d551687df0c874e6262b5ec7ebb574f2b1980 (diff) | |
download | vyatta-cfg-4311b83716b52b47969e4523128c77131c4da87e.tar.gz vyatta-cfg-4311b83716b52b47969e4523128c77131c4da87e.zip |
Vyatta::Config - exists simplification
No need for if (-d node) { return ...
can just use use return ( -d node )
-rwxr-xr-x | lib/Vyatta/Config.pm | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/Vyatta/Config.pm b/lib/Vyatta/Config.pm index 4b3690f..a66d6c8 100755 --- a/lib/Vyatta/Config.pm +++ b/lib/Vyatta/Config.pm @@ -271,12 +271,7 @@ sub exists { $node =~ s/\//%2F/g; $node =~ s/\s+/\//g; - if ( -d "$self->{_new_config_dir_base}$self->{_current_dir_level}/$node" ) { - #print "DEBUG: the dir is there\n"; - return !0; - } else { - return undef; - } + return ( -d "$self->{_new_config_dir_base}$self->{_current_dir_level}/$node" ); } ## existsOrig("node") @@ -286,11 +281,7 @@ sub existsOrig { $node =~ s/\//%2F/g; $node =~ s/\s+/\//g; - if ( -d "$self->{_active_dir_base}$self->{_current_dir_level}/$node" ) { - return 1; - } else { - return undef; - } + return ( -d "$self->{_active_dir_base}$self->{_current_dir_level}/$node" ); } ## isDeleted("node") |