mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-19 02:16:34 +08:00
Optimize calls to std::string::find() and friends for a single char.
The character literal overload is more efficient. More info at: http://clang.llvm.org/extra/clang-tidy/checks/performance-faster-string-find.html
This commit is contained in:
@@ -65,8 +65,8 @@ Ptr<TrackerFeature> TrackerFeature::create( const String& trackerFeatureType )
|
||||
{
|
||||
if( trackerFeatureType.find( "FEATURE2D" ) == 0 )
|
||||
{
|
||||
size_t firstSep = trackerFeatureType.find_first_of( "." );
|
||||
size_t secondSep = trackerFeatureType.find_last_of( "." );
|
||||
size_t firstSep = trackerFeatureType.find_first_of('.');
|
||||
size_t secondSep = trackerFeatureType.find_last_of('.');
|
||||
|
||||
String detector = trackerFeatureType.substr( firstSep, secondSep - firstSep );
|
||||
String descriptor = trackerFeatureType.substr( secondSep, trackerFeatureType.length() - secondSep );
|
||||
|
Reference in New Issue
Block a user