diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-05-02 10:20:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-05-02 11:20:32 +0100 |
commit | 2b168feccee9c367152e106386101be903e4f1db (patch) | |
tree | e2dd3db17f81bb6e73c57c7357b0924cd3f88602 | |
parent | 6f0503c82c0a019678458ded9e339a71f96d837d (diff) |
Related: fdo#49208 implement operator== with faster equals
we have an optimized equals which checks that the strings being
compared for equality share the same underlying pImpl, but out
operator== implementations don't use it!
Change-Id: Ie5c464494ff875315a5ca369a2da80c22c29f431
-rw-r--r-- | sal/inc/rtl/string.hxx | 2 | ||||
-rw-r--r-- | sal/inc/rtl/ustring.hxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx index 1701b28b48b5..0d90b53239d3 100644 --- a/sal/inc/rtl/string.hxx +++ b/sal/inc/rtl/string.hxx @@ -712,7 +712,7 @@ public: } friend sal_Bool operator == ( const OString& rStr1, const OString& rStr2 ) SAL_THROW(()) - { return rStr1.getLength() == rStr2.getLength() && rStr1.compareTo( rStr2 ) == 0; } + { return rStr1.equals(rStr2); } friend sal_Bool operator != ( const OString& rStr1, const OString& rStr2 ) SAL_THROW(()) { return !(operator == ( rStr1, rStr2 )); } friend sal_Bool operator < ( const OString& rStr1, const OString& rStr2 ) SAL_THROW(()) diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx index 883fb93e5881..f3d224ecdb0f 100644 --- a/sal/inc/rtl/ustring.hxx +++ b/sal/inc/rtl/ustring.hxx @@ -988,7 +988,7 @@ public: } friend sal_Bool operator == ( const OUString& rStr1, const OUString& rStr2 ) SAL_THROW(()) - { return rStr1.getLength() == rStr2.getLength() && rStr1.compareTo( rStr2 ) == 0; } + { return rStr1.equals(rStr2); } friend sal_Bool operator == ( const OUString& rStr1, const sal_Unicode * pStr2 ) SAL_THROW(()) { return rStr1.compareTo( pStr2 ) == 0; } friend sal_Bool operator == ( const sal_Unicode * pStr1, const OUString& rStr2 ) SAL_THROW(()) |