1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/extmk.rb (extract_makefile): should sort after map, not before

it.  in this case there is no difference, but we should write better
  code.  this bad smell was caught by nagachika.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2011-12-08 14:28:28 +00:00
parent 63fe8b697c
commit f6a2a43116
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,9 @@
Thu Dec 8 23:26:11 2011 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/extmk.rb (extract_makefile): should sort after map, not before
it. in this case there is no difference, but we should write better
code. this bad smell was caught by nagachika.
Thu Dec 8 22:31:13 2011 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/extmk.rb (extract_makefile): need to sort the array of current

View file

@ -73,7 +73,7 @@ def extract_makefile(makefile, keep = true)
end
return false
end
srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")].sort.map {|fn| File.basename(fn)}
srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")].map {|fn| File.basename(fn)}.sort
if !srcs.empty?
old_srcs = m[/^ORIG_SRCS[ \t]*=[ \t](.*)/, 1] or return false
old_srcs.split.sort == srcs or return false