This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] performance-faster-string-find string-view
ClosedPublic

Authored by njames93 on Jun 28 2020, 8:20 AM.

Details

Summary

Extend the default string like classes to include std::basic_string_view.

Diff Detail

Event Timeline

njames93 created this revision.Jun 28 2020, 8:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2020, 8:20 AM
aaron.ballman added inline comments.Jun 29 2020, 4:22 AM
clang-tools-extra/docs/clang-tidy/checks/performance-faster-string-find.rst
27

I'm not certain how to read that last sentence (I read it as: the list of methods is considered fixed and cannot be extended, which seems like a bad interpretation). Maybe it's talking about fix-its instead?

Regardless, the typo consired -> consider should be fixed.

njames93 marked an inline comment as done.Jun 29 2020, 7:48 AM
njames93 added inline comments.
clang-tools-extra/docs/clang-tidy/checks/performance-faster-string-find.rst
27

That typo was here before I got here, but I think it means The list of methods inside the classes to consider are fixed. In other words you can't make the check detect calls to ::MyStringClass::MyFind().

Does The list of methods inside the classes to consider are fixed. sound like a good replacement for the it?

aaron.ballman added inline comments.Jun 29 2020, 8:13 AM
clang-tools-extra/docs/clang-tidy/checks/performance-faster-string-find.rst
27

Oh, I understand now, thank you! The "fixed" keeps throwing me though, so I wonder if this is better still: The check will only consider member functions named "find", "rfind", "find_first_of", "find_first_not_of", "find_last_of", or "find_last_not_of" within these classes. or something?

njames93 updated this revision to Diff 274200.Jun 29 2020, 12:26 PM

Update docs

This revision is now accepted and ready to land.Jun 30 2020, 5:27 AM
This revision was automatically updated to reflect the committed changes.