Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Development checks should detect more anti-patterns #2314

@lemire

Description

@lemire

Currently, some patterns will lead to failure, but there is no warning. The are the cases where we are current iterating over an array or an object and within the loop, we access the array or the object being iterated over.

for(auto value : myobject) {
  myobject.reset();
}

or

for(auto value : myobject) {
  if(...) { myobject["mykey"]; }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions