Skip to content

Commit d971ad5

Browse files
ekohlchris1984
authored andcommitted
Fix warning on nil comparison
This uses the more efficient /regex/.match?(value) syntax that also doesn't raise any warning if id is nil.
1 parent 4c62859 commit d971ad5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/fog/vsphere/compute.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def managed_obj_id(obj)
347347
end
348348

349349
def is_uuid?(id)
350-
!(id =~ /[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/).nil?
350+
/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/.match?(id)
351351
end
352352
end
353353

0 commit comments

Comments
 (0)