diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-09 12:20:56 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-16 18:41:25 -0700 |
commit | cb760f9ab0f1a8d27f2fc5a607703f04b20e5c06 (patch) | |
tree | 4f52727a302fe5a4e292c0fde7d1c66387b195ee /lib | |
parent | 51581a0d11ddfac8db97712c6c3c680910db706c (diff) | |
download | chef-cb760f9ab0f1a8d27f2fc5a607703f04b20e5c06.tar.gz |
autofixing Performance/TimesMap
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/win32/net.rb | 2 | ||||
-rw-r--r-- | lib/chef/win32/security/sid.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/win32/net.rb b/lib/chef/win32/net.rb index 0454b17d49..09db2af89d 100644 --- a/lib/chef/win32/net.rb +++ b/lib/chef/win32/net.rb @@ -207,7 +207,7 @@ class Chef def self.members_to_lgrmi3(members) buf = FFI::MemoryPointer.new(LOCALGROUP_MEMBERS_INFO_3, members.size) - members.size.times.collect do |i| + Array.new(members.size) do |i| member_info = LOCALGROUP_MEMBERS_INFO_3.new( buf + i * LOCALGROUP_MEMBERS_INFO_3.size) member_info[:lgrmi3_domainandname] = FFI::MemoryPointer.from_string(wstring(members[i])) diff --git a/lib/chef/win32/security/sid.rb b/lib/chef/win32/security/sid.rb index 9951b931c9..f6b88c60ce 100644 --- a/lib/chef/win32/security/sid.rb +++ b/lib/chef/win32/security/sid.rb @@ -279,7 +279,7 @@ class Chef status = NetUserEnum(servername, level, filter, bufptr, prefmaxlen, entriesread, totalentries, resume_handle) if status == NERR_Success || status == ERROR_MORE_DATA - entriesread.read_long.times.collect do |i| + Array.new(entriesread.read_long) do |i| user_info = USER_INFO_3.new(bufptr.read_pointer + i * USER_INFO_3.size) # Check if the account is the Administrator account # RID for the Administrator account is always 500 and it's privilage is set to USER_PRIV_ADMIN |