Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary checks in baseparser #112

Merged
merged 1 commit into from
Feb 15, 2024

Commits on Feb 15, 2024

  1. 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.
    naitoh committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    26201d9 View commit details
    Browse the repository at this point in the history