mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* golf_prelude.rb (@@golf_hash): for performance improvement.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									ce1834d658
								
							
						
					
					
						commit
						75ee1d5252
					
				
					 2 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,7 @@
 | 
			
		|||
Sun Dec 30 23:19:06 2007  WATANABE Hirofumi  <eban@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* golf_prelude.rb (@@golf_hash): for performance improvement.
 | 
			
		||||
 | 
			
		||||
Sun Dec 30 22:44:50 2007  Tadayoshi Funaba  <tadf@dotrb.org>
 | 
			
		||||
 | 
			
		||||
	* lib/date.rb (_valid_time?): I'm not sure to recommend such an
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,9 +1,9 @@
 | 
			
		|||
SCRIPT_LINES__={}
 | 
			
		||||
 | 
			
		||||
class Object
 | 
			
		||||
  @@golf_hash = {}
 | 
			
		||||
  def method_missing m, *a, &b
 | 
			
		||||
    r = /^#{m}/
 | 
			
		||||
    t = (methods + private_methods).sort.find{|e|r=~e}
 | 
			
		||||
    t = @@golf_hash[[m,self.class]] ||= (methods + private_methods).sort.find{|e|/^#{m}/=~e}
 | 
			
		||||
    t ? __send__(t, *a, &b) : super
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue