From 15e62110cf70c4de39390b03b7b92f656a52e5c6 Mon Sep 17 00:00:00 2001 From: Lynix Date: Wed, 28 May 2014 00:28:50 +0200 Subject: [PATCH] Added fastpath for operator==(const String&, const String&) Former-commit-id: 2f0c5dff353ba9225ff5888fe35c744790bb1f95 --- src/Nazara/Core/String.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Nazara/Core/String.cpp b/src/Nazara/Core/String.cpp index d7293231d..8f2bf257f 100644 --- a/src/Nazara/Core/String.cpp +++ b/src/Nazara/Core/String.cpp @@ -4206,6 +4206,9 @@ bool operator==(const NzString& first, const NzString& second) if (first.m_sharedString->size != second.m_sharedString->size) return false; + if (first.m_sharedString == second.m_sharedString) + return true; + return std::strcmp(first.m_sharedString->string, second.m_sharedString->string) == 0; }