Skip to content

Commit 75ee1d5

Browse files
committed
* 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
1 parent ce1834d commit 75ee1d5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Sun Dec 30 23:19:06 2007 WATANABE Hirofumi <eban@ruby-lang.org>
2+
3+
* golf_prelude.rb (@@golf_hash): for performance improvement.
4+
15
Sun Dec 30 22:44:50 2007 Tadayoshi Funaba <tadf@dotrb.org>
26

37
* lib/date.rb (_valid_time?): I'm not sure to recommend such an

golf_prelude.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
SCRIPT_LINES__={}
22

33
class Object
4+
@@golf_hash = {}
45
def method_missing m, *a, &b
5-
r = /^#{m}/
6-
t = (methods + private_methods).sort.find{|e|r=~e}
6+
t = @@golf_hash[[m,self.class]] ||= (methods + private_methods).sort.find{|e|/^#{m}/=~e}
77
t ? __send__(t, *a, &b) : super
88
end
99

0 commit comments

Comments
 (0)