diff options
author | Tim Smith <tsmith@chef.io> | 2018-02-27 01:21:39 -0800 |
---|---|---|
committer | Thom May <thom@may.lt> | 2018-02-27 09:21:39 +0000 |
commit | 2eae0fce4a45bd3d93e7eabefb556c9da1ca9b93 (patch) | |
tree | 71eed91f8a284bb1b070c45613d21c860577d23c /lib/chef/provider/mount/aix.rb | |
parent | 7bc08c599d9033e4c64f95f737c931689938ac4f (diff) | |
download | chef-2eae0fce4a45bd3d93e7eabefb556c9da1ca9b93.tar.gz |
Don't use .eql? in the aix mount provider (#6915)
eql? doesn't make sense for string comparison and it's just 20% slower
than ==
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/provider/mount/aix.rb')
-rw-r--r-- | lib/chef/provider/mount/aix.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/chef/provider/mount/aix.rb b/lib/chef/provider/mount/aix.rb index ef760b0ba6..6f38edeb44 100644 --- a/lib/chef/provider/mount/aix.rb +++ b/lib/chef/provider/mount/aix.rb @@ -1,6 +1,5 @@ # -# Author:: -# Copyright:: Copyright 2009-2016, Chef Software Inc. +# Copyright:: Copyright 2009-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -41,11 +40,11 @@ class Chef enabled = false regex_arr = device_fstab_regex.split(":") - if regex_arr.size.eql?(2) + if regex_arr.size == 2 nodename = regex_arr[0] - devicename = regex_arr[1] + devicename = regex_arr[1] else - devicename = regex_arr[0] + devicename = regex_arr[0] end # lsfs o/p = #MountPoint:Device:Vfs:Nodename:Type:Size:Options:AutoMount:Acct # search only for current mount point @@ -77,9 +76,9 @@ class Chef Chef::Log.debug("Found mount point #{@new_resource.mount_point} :: device_type #{@current_resource.device_type} in /etc/filesystems") next when /^#{Regexp.escape(@new_resource.mount_point)}:(.*?):(.*?):(.*?):(.*?):(.*?):(.*?):(.*?):(.*?)/ - if $3.split("=")[0].eql?("LABEL") || $1.split("=")[0].eql?("LABEL") + if $3.split("=")[0] == "LABEL" || $1.split("=")[0] == "LABEL" @current_resource.device_type("label") - elsif $3.split("=")[0].eql?("UUID") || $1.split("=")[0].eql?("UUID") + elsif $3.split("=")[0] == "UUID" || $1.split("=")[0] == "UUID" @current_resource.device_type("uuid") else @current_resource.device_type("device") |