mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	Remove rotate from the list of call_names
In some cases it returns `self` and not a copy.
This commit is contained in:
		
							parent
							
								
									5f6c14c9d6
								
							
						
					
					
						commit
						a219a73258
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -33,7 +33,6 @@ module Ameba::Rule::Performance
 | 
			
		|||
  #     - sort_by
 | 
			
		||||
  #     - shuffle
 | 
			
		||||
  #     - reverse
 | 
			
		||||
  #     - rotate
 | 
			
		||||
  # ```
 | 
			
		||||
  class ChainedCallsWithNoBang < Base
 | 
			
		||||
    properties do
 | 
			
		||||
| 
						 | 
				
			
			@ -42,7 +41,7 @@ module Ameba::Rule::Performance
 | 
			
		|||
      # All of those have bang method variants returning `self`
 | 
			
		||||
      # and are not modifying the receiver type (like `compact` does),
 | 
			
		||||
      # thus are safe to switch to the bang variant.
 | 
			
		||||
      call_names : Array(String) = %w(uniq sort sort_by shuffle reverse rotate)
 | 
			
		||||
      call_names : Array(String) = %w(uniq sort sort_by shuffle reverse)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    # All these methods are allocating a new object
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue