Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unnecessary checks in baseparser
[Why] https://github.com/ruby/rexml/blob/444c9ce7449d3c5a75ae50087555ec73ae1963a8/lib/rexml/parsers/baseparser.rb#L352-L425 ``` next_data = @source.buffer if next_data.size < 2 @source.read next_data = @source.buffer end if next_data[0] == ?< : (ommit) : else # next_data is a string of one or more characters other than '<'. md = @source.match( TEXT_PATTERN, true ) # TEXT_PATTERN = /\A([^<]*)/um text = md[1] if md[0].length == 0 # md[0].length is greater than or equal to 1. @source.match( /(\s+)/, true ) end ``` This is an unnecessary check because md[0].length is greater than or equal to 1.
- Loading branch information