From 85d13f6165ece405b66f6c4d6771043375830c1e Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 1 Jan 2009 12:09:34 +0000 Subject: [PATCH] * ext/socket/mkconstants.rb: check all alias possibility. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ ext/socket/mkconstants.rb | 24 ++++-------------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3318020060..7d03094923 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Jan 1 21:08:34 2009 Tanaka Akira + + * ext/socket/mkconstants.rb: check all alias possibility. + Thu Jan 1 20:59:55 2009 Tanaka Akira * ext/socket/mkconstants.rb: more possible aliases. diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb index f260d7bdef..d3eac7f3f1 100644 --- a/ext/socket/mkconstants.rb +++ b/ext/socket/mkconstants.rb @@ -93,28 +93,12 @@ ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_name_to_int(str_var, len_var, } EOS -MAYBE_ALIAS = [ - ["AF_UNIX", "AF_LOCAL"], - ["AF_ISO", "AF_OSI"], - ["AF_E164", "AF_ISDN"], - ["AF_NS", "AF_IPX"], -] - def each_alias(pat) - h = {} - each_name(pat) {|name| - h[name] = [name] - } - MAYBE_ALIAS.each {|names| - a = [] - names.each {|n| - a << n if h.delete n - } - h[a.first] = a - } - h.each_value {|names| - yield names + names = [] + each_name(pat) {|n| + names << n } + yield names end ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_int_to_name(int_var, pat)")