summaryrefslogtreecommitdiff
path: root/include/xmlreader
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-10-22 11:46:23 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-10-22 11:46:23 +0200
commit4b89bd55b094ff5ed0162e2f34cd560fbf47e524 (patch)
tree6ea91ddf6b6f2d000465b0cf1821b6bf0eb27e88 /include/xmlreader
parentd9f303a030f35404b31654bcf7caa4cca5532165 (diff)
Speed up xmlreader::Span::equals
Change-Id: Id1613a100e96667717cc32f44f84c0916055ea01
Diffstat (limited to 'include/xmlreader')
-rw-r--r--include/xmlreader/span.hxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/xmlreader/span.hxx b/include/xmlreader/span.hxx
index 5e85cd0d5595..b44c0eb61adc 100644
--- a/include/xmlreader/span.hxx
+++ b/include/xmlreader/span.hxx
@@ -50,8 +50,10 @@ struct OOO_DLLPUBLIC_XMLREADER Span {
inline bool is() const { return begin != 0; }
inline bool equals(Span const & text) const {
- return rtl_str_compare_WithLength(
- begin, length, text.begin, text.length) == 0;
+ return length == text.length
+ && (rtl_str_compare_WithLength(
+ begin, length, text.begin, text.length)
+ == 0);
}
inline bool equals(char const * textBegin, sal_Int32 textLength) const {