Skip to content

Improve warnings in `isempty-vs-count` check

Jan Holthuis requested to merge hlzhs/clazy:isempty-vs-count-with-arg into master

This changes the isempty-vs-count check for two cases:

  • The count(key) method of a QMap, QHash, QMultiHash or QMultiMap is called. In this case contains(key) should be used instead of isEmpty().
  • The count(key, value) method of a QMultiMap/QMultiMap is called. In this case contains(key, value) should be used instead of isEmpty().

Note: I was not able to test this locally, due to #10.

Edited by Jan Holthuis

Merge request reports