Skip to content

Bug creating douplicating lines if several filters are set #3

@davideberlein

Description

@davideberlein

Hey,

it seems like your code has a major bug producing douplicates of valid lines of more than one filter is set:

     for (_j = 0; _j < opt.filters.length; _j++) {
        if (! lines[_i].match(opt.filters[_j])) {
            newLines.push(lines[_i]);
        }
      }

In the inner for loop you have to check if the line was already added or if better would be to add it in the first place and remove it if one of the filters match.
If you don't do this the line will be added for every filter that doesn't match.

Greetz

David

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions