Use StringRef in pluralise implementation

This means that it can no longer be safely made ahead of time,
but nothing in our existing code used it like that. Normally it
is constructed and used in the same expression, which is now
more efficient.
This commit is contained in:
Martin Hořeňovský
2021-09-08 00:24:40 +02:00
parent c0f866c7cf
commit b3a84c7983
2 changed files with 15 additions and 7 deletions
@@ -94,11 +94,6 @@ namespace Catch {
return subStrings;
}
pluralise::pluralise( std::size_t count, std::string const& label )
: m_count( count ),
m_label( label )
{}
std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ) {
os << pluraliser.m_count << ' ' << pluraliser.m_label;
if( pluraliser.m_count != 1 )