[ruby-cvs:67213] k0kubun:r60032 (trunk): erb.rb: drop unreachable method

k0kubun at ruby-lang.org k0kubun at ruby-lang.org
Tue Sep 26 20:50:07 JST 2017


k0kubun	2017-09-26 20:50:07 +0900 (Tue, 26 Sep 2017)

  New Revision: 60032

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60032

  Log:
    erb.rb: drop unreachable method
    
    This seems to be unreachable from first introduction at r21286.
    
    In ERB implementation, `#empty?` is only called for each member of
    return value of `String#scan`, and `ERB::Compiler::PercentLine` is never
    returned from `String#scan`.
    
    Also, in `ERB::Compiler#compile`, as it's yielded only when stag is nil,
    methods called to `ERB::Compiler::PercentLine` object yielded from
    `ERB::Compiler::TrimScanner#scan` are only: `#nil?`, `#==`, `to_s`.
    
    Thus `ERB::Compiler::PercentLine#empty?` is never used.

  Modified files:
    trunk/lib/erb.rb


More information about the ruby-cvs mailing list