summaryrefslogtreecommitdiff
path: root/src/cppunit
diff options
context:
space:
mode:
Diffstat (limited to 'src/cppunit')
-rw-r--r--src/cppunit/TypeInfoHelper.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/cppunit/TypeInfoHelper.cpp b/src/cppunit/TypeInfoHelper.cpp
index cf0a8c1..a3fff08 100644
--- a/src/cppunit/TypeInfoHelper.cpp
+++ b/src/cppunit/TypeInfoHelper.cpp
@@ -11,17 +11,12 @@ namespace CppUnit {
std::string
TypeInfoHelper::getClassName( const std::type_info &info )
{
- static std::string classPrefix( "class " );
- std::string name( info.name() );
+ static std::string classPrefix( "class " );
+ std::string name( info.name() );
- bool has_class_prefix = 0 ==
-#if CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
- name.compare( classPrefix, 0, classPrefix.length() );
-#else
- name.compare( 0, classPrefix.length(), classPrefix );
-#endif
-
- return has_class_prefix ? name.substr( classPrefix.length() ) : name;
+ if ( name.substr( 0, classPrefix.length() ) == classPrefix )
+ return name.substr( classPrefix.length() );
+ return name;
}