mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Make suggestions order stable [Bug #16263]
As the result order of `DidYouMean::SpellChecker#correct` is undefined, keep the order of the original candidates.
This commit is contained in:
		
							parent
							
								
									71ffe40a44
								
							
						
					
					
						commit
						263ee6639d
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1787,7 +1787,7 @@ XXX
 | 
			
		|||
    end
 | 
			
		||||
    all_candidates.select! {|cand| cand.is_a?(String) }
 | 
			
		||||
    checker = DidYouMean::SpellChecker.new(dictionary: all_candidates)
 | 
			
		||||
    DidYouMean.formatter.message_for(checker.correct(opt))
 | 
			
		||||
    DidYouMean.formatter.message_for(all_candidates & checker.correct(opt))
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def candidate(word)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue