lib/sym/app/private_key/detector.rb in sym-2.8.5 vs lib/sym/app/private_key/detector.rb in sym-2.10.0

- old
+ new

@@ -21,15 +21,14 @@ # Returns the first valid 32-bit key obtained by running the above # procs on a given string. def read! KeySourceCheck::CHECKS.each do |source_check| - if result = source_check.detect(self) rescue nil - if key_ = normalize_key(result.key) - key_source_ = result.to_s - return key_, key_source_ - end + next unless result = source_check.detect(self) rescue nil + if key_ = normalize_key(result.key) + key_source_ = result.to_s + return key_, key_source_ end end nil end @@ -49,11 +48,9 @@ decoded = Base64Decoder.new(key).key decoded.length == 32 ? key : nil rescue nil end - else - nil end end end end end