Uploaded image for project: 'Commons CSV'
  1. Commons CSV
  2. CSV-55

Replace while(true)-loop in CSVParser.getRecord() with do-while-loop

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.0
    • 1.0
    • Parser
    • None

    Description

      The current implementation of getRecords() uses a while(true) loop, that gets canceled by an if statement:

      while (true) {
          reusableToken.reset();
          lexer.nextToken(reusableToken);
          // omitted
          if(reusableToken.type != TOKEN) {
              break;
          }
      }
      

      This should be replaced by a do-while-loop:

      do {
          reusableToken.reset();
          lexer.nextToken(reusableToken);
          // omitted
      } while (reusableToken.type == TOKEN);
      

      Attachments

        1. CSV-55.txt
          1 kB
          Benedikt Ritter

        Activity

          People

            Unassigned Unassigned
            britter Benedikt Ritter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: