Commit fc6cad5
authored
Remove unnecessary checks in baseparser (#112)
## 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] == ?<
:
(omit)
:
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.1 parent 444c9ce commit fc6cad5
1 file changed
+0
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | 423 | | |
427 | 424 | | |
428 | 425 | | |
| |||
0 commit comments