Port from container::count() and length() to size()
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:
auto QtContainerClass = anyOf(
expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o));
makeRule(cxxMemberCallExpr(on(QtContainerClass),
callee(cxxMethodDecl(hasAnyName({"count", "length"),
parameterCountIs(0))))),
changeTo(cat(access(o, cat("size"), "()"))),
cat("use 'size()' instead of 'count()/length()'"))
a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.
Change-Id: Id816b39977e17712fd078900037efc45f66a0175
Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| commit | b29b3eacc3c480c39d84576705d7e1f2716a0645 |
| parent | 18567efea34442bf2ba6dbd5374cf835649d7019 |
| author | Marc Mutz <marc.mutz@qt.io> |
| committer | Marc Mutz <marc.mutz@qt.io> |
| commit time | Thu, 6 Oct 2022 18:11:33 +0200 |
- M src/remoteobjects/qremoteobjectcontainers.cpp
- M src/remoteobjects/qremoteobjectnode.cpp
- M src/remoteobjects/qremoteobjectsource.cpp
- M src/repparser/qregexparser.h
- M tests/auto/integration/tst_integration.cpp
- M tests/auto/integration_external/client/main.cpp
- M tests/auto/integration_multiprocess/client/main.cpp
- M tests/auto/modelreplica/tst_modelreplicatest.cpp
- M tests/auto/modelview/tst_modelview.cpp
- M tests/auto/proxy/tst_proxy.cpp
- M tests/auto/proxy_multiprocess/client/main.cpp
- M tests/auto/qml/usertypes/tst_usertypes.cpp
- M tests/auto/repc/signature/matchAndQuit/main.cpp
- M tests/auto/repc/signature/state/main.cpp
- M tests/auto/repparser/tst_parser.cpp
- M tests/auto/restart/client/main.cpp
- M tools/repc/main.cpp
- M tools/repc/repcodegenerator.cpp