提交 6a70f2dd 编写于 作者: X Xavier Noria

simplifies a regexp

The new regexp has less work to do, we anchor a fixed string at the end
and need no group.
上级 2abe9502
......@@ -331,7 +331,7 @@ def clear
def require_or_load(file_name, const_path = nil)
log_call file_name, const_path
file_name = $1 if file_name =~ /^(.*)\.rb$/
file_name = $` if file_name =~ /\.rb\z/
expanded = File.expand_path(file_name)
return if loaded.include?(expanded)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册