summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-02-26 13:47:35 -0800
committerTim Smith <tsmith@chef.io>2018-02-26 13:48:41 -0800
commit9b845f560b031549052862f75b69aa814a1f88e8 (patch)
tree5721f33932b983798a5fa56b4636b07eb20c3a10
parentbd43de8cb5b58dc7731d2945434aa2edf3d585e4 (diff)
downloadchef-eql_aix_mount.tar.gz
Don't use .eql? in the aix mount providereql_aix_mount
eql? doesn't make sense for string comparison and it's just 20% slower than == Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/provider/mount/aix.rb13
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")