mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Replace gsub with tr
Using `tr` is faster than `gsub` when replacing a single character in a string with another single character
This commit is contained in:
+1
-1
@@ -170,7 +170,7 @@ module MRuby
|
||||
end
|
||||
|
||||
def funcname
|
||||
@funcname ||= @name.gsub('-', '_')
|
||||
@funcname ||= @name.tr('-', '_')
|
||||
end
|
||||
|
||||
def compilers
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ ARGV.each do |gem|
|
||||
|
||||
case RbConfig::CONFIG['host_os']
|
||||
when /mswin(?!ce)|mingw|bccwin/
|
||||
gem = gem.gsub('\\', '/')
|
||||
gem = gem.tr('\\', '/')
|
||||
end
|
||||
|
||||
Dir["#{gem}/bintest/**/*.rb"].each do |file|
|
||||
|
||||
Reference in New Issue
Block a user