From 3d704888eb6f5c72edd3abe6e5e48a62ef218975 Mon Sep 17 00:00:00 2001 From: tsepez Date: Tue, 13 Sep 2016 18:10:22 -0700 Subject: Add check for trivial string equality BUG= Review-Url: https://codereview.chromium.org/2338623005 --- core/fxcrt/fx_basic_wstring.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/fxcrt/fx_basic_wstring.cpp') diff --git a/core/fxcrt/fx_basic_wstring.cpp b/core/fxcrt/fx_basic_wstring.cpp index 8837c6bb3b..88fc588947 100644 --- a/core/fxcrt/fx_basic_wstring.cpp +++ b/core/fxcrt/fx_basic_wstring.cpp @@ -180,6 +180,9 @@ bool CFX_WideString::operator==(const CFX_WideStringC& str) const { } bool CFX_WideString::operator==(const CFX_WideString& other) const { + if (m_pData == other.m_pData) + return true; + if (IsEmpty()) return other.IsEmpty(); -- cgit v1.2.3