os/mac/mach: simplify
We can avoid having to define a local variable and then reference it inside these blocks by passing a proc instead.
This commit is contained in:
		
							parent
							
								
									acae97e70f
								
							
						
					
					
						commit
						b80940e1d8
					
				@ -89,18 +89,15 @@ module MachOShim
 | 
			
		||||
 | 
			
		||||
  def dynamically_linked_libraries(except: :none, resolve_variable_references: true)
 | 
			
		||||
    lcs = macho.dylib_load_commands.reject { |lc| lc.type == except }
 | 
			
		||||
 | 
			
		||||
    names = lcs.map(&:name).map(&:to_s).uniq
 | 
			
		||||
 | 
			
		||||
    names.map! { |name| resolve_variable_name(name) } if resolve_variable_references
 | 
			
		||||
    names.map!(&method(:resolve_variable_name)) if resolve_variable_references
 | 
			
		||||
 | 
			
		||||
    names
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def rpaths(resolve_variable_references: true)
 | 
			
		||||
    names = macho.rpaths
 | 
			
		||||
 | 
			
		||||
    names.map! { |name| resolve_variable_name(name) } if resolve_variable_references
 | 
			
		||||
    names.map!(&method(:resolve_variable_name)) if resolve_variable_references
 | 
			
		||||
 | 
			
		||||
    names
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user