incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Created: (STDCXX-176) std::string::find() inefficient
Date Wed, 03 May 2006 22:43:17 GMT
std::string::find() inefficient
-------------------------------

         Key: STDCXX-176
         URL: http://issues.apache.org/jira/browse/STDCXX-176
     Project: C++ Standard Library
        Type: Improvement

  Components: 21. Strings  
    Versions: 4.1.3    
 Environment: all
    Reporter: Martin Sebor
 Assigned to: Martin Sebor 
    Priority: Critical
     Fix For: 4.1.4


The naive implementation of std::basic_string::find() in string.cc is quite inefficient:

    for (size_type __xpos = __pos; __xpos + __n <= size (); ++__xpos) {
        if (!traits_type::compare (_C_data + __xpos, __s, __n))
            return __xpos;
    }

    return npos;

See http://svn.apache.org/viewcvs.cgi/incubator/stdcxx/branches/4.1.3/include/string.cc?rev=366577&view=markup

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message