From f743351c6082f2b86fa47713b870ab8d685a7226 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 9 Aug 2014 17:37:57 -0500 Subject: [PATCH] Cache options hash lookup on the stack --- Library/Homebrew/keg_fix_install_names.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/keg_fix_install_names.rb b/Library/Homebrew/keg_fix_install_names.rb index 7a827b3d49..f94c1facc2 100644 --- a/Library/Homebrew/keg_fix_install_names.rb +++ b/Library/Homebrew/keg_fix_install_names.rb @@ -72,11 +72,13 @@ class Keg # lib/, and ignores binaries and other mach-o objects # Note that this doesn't attempt to distinguish between libstdc++ versions, # for instance between Apple libstdc++ and GNU libstdc++ - def detect_cxx_stdlibs(opts={:skip_executables => false}) + def detect_cxx_stdlibs(options={}) + options = { :skip_executables => false }.merge(options) + skip_executables = options[:skip_executables] results = Set.new mach_o_files.each do |file| - next if file.mach_o_executable? && opts[:skip_executables] + next if file.mach_o_executable? && skip_executables dylibs = file.dynamically_linked_libraries results << :libcxx unless dylibs.grep(/libc\+\+.+\.dylib/).empty? results << :libstdcxx unless dylibs.grep(/libstdc\+\+.+\.dylib/).empty?