From f3e0252e5e51c8e47c7ad4f8d2b6235f3d5ee7af Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 21 Jan 2004 07:44:24 +0000 Subject: [PATCH] * lib/mkmf.rb (merge_libs): squeeze successive same libraries. [ruby-dev:22652] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/mkmf.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index b724e05c8c..31a008d28f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jan 21 16:44:15 2004 Nobuyoshi Nakada + + * lib/mkmf.rb (merge_libs): squeeze successive same libraries. + [ruby-dev:22652] + Wed Jan 21 16:10:36 2004 Nobuyoshi Nakada * lib/base64.rb: enclosed in a module. [ruby-core:02285] diff --git a/lib/mkmf.rb b/lib/mkmf.rb index fb62c271ea..d3076f40d3 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -117,6 +117,7 @@ def merge_libs(*libs) libs.inject([]) do |x, y| xy = x & y xn = yn = 0 + y = y.inject([]) {|ary, e| ary.last == e ? ary : ary << e} y.each_with_index do |v, yi| if xy.include?(v) xi = [x.index(v), xn].max()