mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
lib/uri/rfc2396_parser.rb (initialize): reduce bytecode size
Reduce the initialize method from 2088 to 1332 bytes on 32-bit x86 Measurement obtained using `memsize_of_all', as `memsize_of' is non-recursive: a = ObjectSpace.memsize_of_all(RubyVM::InstructionSequence) RubyVM::InstructionSequence.compile(src) b = ObjectSpace.memsize_of_all(RubyVM::InstructionSequence) p(b - a) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e6c8421734
commit
f83116e620
2 changed files with 7 additions and 2 deletions
|
@ -98,11 +98,11 @@ module URI
|
|||
#
|
||||
def initialize(opts = {})
|
||||
@pattern = initialize_pattern(opts)
|
||||
@pattern.each_value {|v| v.freeze}
|
||||
@pattern.each_value(&:freeze)
|
||||
@pattern.freeze
|
||||
|
||||
@regexp = initialize_regexp(@pattern)
|
||||
@regexp.each_value {|v| v.freeze}
|
||||
@regexp.each_value(&:freeze)
|
||||
@regexp.freeze
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue