diff options
Diffstat (limited to 'src/uscxml/Convenience.h')
-rw-r--r-- | src/uscxml/Convenience.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/uscxml/Convenience.h b/src/uscxml/Convenience.h index 9f4c1a1..0177476 100644 --- a/src/uscxml/Convenience.h +++ b/src/uscxml/Convenience.h @@ -49,7 +49,7 @@ inline bool isNumeric( const char* pszInput, int nNumberBase) { } inline bool iequals(const std::string& a, const std::string& b) { - // this impementation beats boost::iequals 2700ms vs 2100ms for test-performance.scxml + // this impementation beats boost::iequals 2700ms vs 2100ms for test-performance.scxml - we don't care for non-ascii yet unsigned int size = a.size(); if (b.size() != size) return false; @@ -59,6 +59,16 @@ inline bool iequals(const std::string& a, const std::string& b) { return true; } +inline bool equals(const std::string& a, const std::string& b) { + unsigned int size = a.size(); + if (b.size() != size) + return false; + for (unsigned int i = 0; i < size; ++i) + if (a[i] != b[i]) + return false; + return true; +} + // see http://www.cplusplus.com/forum/general/27544/ // Little-endian operating systems: |