Skip to content

Files

Latest commit

 

History

History
11 lines (6 loc) · 471 Bytes

stlIfStrFind.md

File metadata and controls

11 lines (6 loc) · 471 Bytes

Pattern: Misuse of string::find()

Issue: -

Description

Either inefficient or wrong usage of string::find(). string::compare() will be faster if string::find result is compared with 0, because it will not scan the whole string. If your intention is to check that there are no findings in the string, you should compare with std::string::npos.

Further Reading