Don't call strlen in StringRef when the length was already passed
This commit is contained in:
parent
3537b7858f
commit
e7c23b73da
1 changed files with 12 additions and 16 deletions
|
@ -53,11 +53,7 @@ namespace Catch {
|
|||
StringRef::StringRef( char const* rawChars, size_type size ) noexcept
|
||||
: m_start( rawChars ),
|
||||
m_size( size )
|
||||
{
|
||||
size_type rawSize = rawChars == nullptr ? 0 : static_cast<size_type>( std::strlen( rawChars ) );
|
||||
if( rawSize < size )
|
||||
m_size = rawSize;
|
||||
}
|
||||
{}
|
||||
|
||||
StringRef::StringRef( std::string const& stdString ) noexcept
|
||||
: m_start( stdString.c_str() ),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue