Revert "minor perf improvements"

This reverts commit 16a2a8274a7808e63a6c78475e12a7c0ef5812ef.
This commit is contained in:
Baptiste Fontaine 2015-12-26 23:00:38 +01:00
parent 48681c3f3a
commit 169b8fc039
6 changed files with 8 additions and 11 deletions

View File

@ -36,8 +36,7 @@ MAXIMUM_STRING_MATCHES = 100
module Homebrew module Homebrew
def keg_contains(string, keg, ignores) def keg_contains(string, keg, ignores)
@put_string_exists_header = nil @put_string_exists_header, @put_filenames = nil
@put_filenames = nil
def print_filename(string, filename) def print_filename(string, filename)
unless @put_string_exists_header unless @put_string_exists_header

View File

@ -1298,14 +1298,13 @@ module Homebrew
first_warning = true first_warning = true
methods.each do |method| methods.each do |method|
unless checks.respond_to?(method) begin
out = checks.send(method)
rescue NoMethodError
Homebrew.failed = true Homebrew.failed = true
puts "No check available by the name: #{method}" puts "No check available by the name: #{method}"
next next
end end
out = checks.send(method)
unless out.nil? || out.empty? unless out.nil? || out.empty?
if first_warning if first_warning
$stderr.puts <<-EOS.undent $stderr.puts <<-EOS.undent

View File

@ -59,7 +59,7 @@ module Homebrew
url = "https://github.com/Homebrew/homebrew/pull/#{arg}" url = "https://github.com/Homebrew/homebrew/pull/#{arg}"
tap = CoreFormulaRepository.instance tap = CoreFormulaRepository.instance
elsif (testing_match = arg.match %r{brew.sh/job/Homebrew.*Testing/(\d+)/}) elsif (testing_match = arg.match %r{brew.sh/job/Homebrew.*Testing/(\d+)/})
testing_job = testing_match[1] _, testing_job = *testing_match
url = "https://github.com/Homebrew/homebrew/compare/master...BrewTestBot:testing-#{testing_job}" url = "https://github.com/Homebrew/homebrew/compare/master...BrewTestBot:testing-#{testing_job}"
tap = CoreFormulaRepository.instance tap = CoreFormulaRepository.instance
odie "Testing URLs require `--bottle`!" unless ARGV.include?("--bottle") odie "Testing URLs require `--bottle`!" unless ARGV.include?("--bottle")

View File

@ -33,7 +33,7 @@ class CompilerFailure
def self.create(spec, &block) def self.create(spec, &block)
# Non-Apple compilers are in the format fails_with compiler => version # Non-Apple compilers are in the format fails_with compiler => version
if spec.is_a?(Hash) if spec.is_a?(Hash)
major_version = spec.first[1] _, major_version = spec.first
name = "gcc-#{major_version}" name = "gcc-#{major_version}"
# so fails_with :gcc => '4.8' simply marks all 4.8 releases incompatible # so fails_with :gcc => '4.8' simply marks all 4.8 releases incompatible
version = "#{major_version}.999" version = "#{major_version}.999"

View File

@ -1271,7 +1271,7 @@ class Formula
"root_url" => bottle_spec.root_url, "root_url" => bottle_spec.root_url,
} }
bottle_info["files"] = {} bottle_info["files"] = {}
bottle_spec.collector.each_key do |os| bottle_spec.collector.keys.each do |os|
checksum = bottle_spec.collector[os] checksum = bottle_spec.collector[os]
bottle_info["files"][os] = { bottle_info["files"][os] = {
"url" => "#{bottle_spec.root_url}/#{Bottle::Filename.create(self, os, bottle_spec.revision)}", "url" => "#{bottle_spec.root_url}/#{Bottle::Filename.create(self, os, bottle_spec.revision)}",

View File

@ -24,8 +24,7 @@ module Utils
obj.inject({}) do |result, (key, val)| obj.inject({}) do |result, (key, val)|
key = key.respond_to?(:to_s) ? key.to_s : key key = key.respond_to?(:to_s) ? key.to_s : key
val = stringify_keys(val) val = stringify_keys(val)
result[key] = val result.merge!(key => val)
result
end end
else else
obj obj