Skip to content

readability-container-size-empty improperly converts c.size() < 0 to c.empty() #72619

Closed
@r-barnes

Description

@r-barnes

Some objects can have a size() which returns negative values and also have an empty() method.

In this case, size() < 0 is not the same thing as empty().

Currently readability-container-size-empty converts x.size() < 0 to x.empty() - this has caused some real problems for us was an unexpected behaviour that isn't made explicit in either the documentation or the code itself.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions