Skip to content

Potentially unneeded memory alloc in StopwordCount #186

@sbadithe

Description

@sbadithe

I don't think we need to create a list in this comprehension:

count = len([word for word in words if word.lower() in swords])

Instead, I think we can just iterate over words and keep a count variable. For very large strings this would save the time and memory needed to alloc the list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions