diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-10 12:42:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-10 15:53:13 +0200 |
commit | 43a6b59539ad573436f43303e9fbe17c12dc9c84 (patch) | |
tree | 24cbf3a9fc84ad38e17ed92ed0a50db48f20f2c5 /comphelper | |
parent | f2a1298ea409141a9190c7789b39546644084980 (diff) |
simplify some OUString compareTo calls
to either startsWith or == or !=
Change-Id: Ie4b4662f5b8e4532cbc1ab36910389e0b3d41ef0
Reviewed-on: https://gerrit.libreoffice.org/39750
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/backupfilehelper.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/misc/storagehelper.cxx | 9 |
2 files changed, 5 insertions, 8 deletions
diff --git a/comphelper/source/misc/backupfilehelper.cxx b/comphelper/source/misc/backupfilehelper.cxx index 7d03c2364b7c..8d64ee3a3ca9 100644 --- a/comphelper/source/misc/backupfilehelper.cxx +++ b/comphelper/source/misc/backupfilehelper.cxx @@ -452,14 +452,14 @@ namespace bool isSameExtension(const ExtensionInfoEntry& rComp) const { - return (maRepository == rComp.maRepository && 0 == maName.compareTo(rComp.maName)); + return (maRepository == rComp.maRepository && maName == rComp.maName); } bool operator<(const ExtensionInfoEntry& rComp) const { if (maRepository == rComp.maRepository) { - if (0 == maName.compareTo(rComp.maName)) + if (maName == rComp.maName) { return mbEnabled < rComp.mbEnabled; } diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index 91374b1712a8..7a1498891511 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -446,16 +446,13 @@ bool OStorageHelper::PathHasSegment( const OUString& aPath, const OUString& aSeg if ( !aSegment.isEmpty() && nPathLen >= nSegLen ) { - OUString aEndSegment = "/" - + aSegment; - - OUString aInternalSegment = aEndSegment - + "/"; + OUString aEndSegment = "/" + aSegment; + OUString aInternalSegment = aEndSegment + "/"; if ( aPath.indexOf( aInternalSegment ) >= 0 ) bResult = true; - if ( !bResult && !aPath.compareTo( aSegment, nSegLen ) ) + if ( !bResult && aPath.startsWith( aSegment ) ) { if ( nPathLen == nSegLen || aPath[nSegLen] == '/' ) bResult = true; |