diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-19 09:07:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-30 10:49:51 +0200 |
commit | d6c32cffb5cc81989b4bb4a221a152bbe607bd98 (patch) | |
tree | 2c4ef9ec2a201ffcfea145ed5a0b901f2b6853ea /store | |
parent | 9ab64dc48a6a61edce6ff3724093162ca1cf8331 (diff) |
loplugin:simplifybool extend to expression like !(a < b || c > d)
mostly to catch stuff from the flatten work, but I think this looks good
in general
Change-Id: I7be5b7bcf1f3d9f980c748ba20793965cef957e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92493
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'store')
-rw-r--r-- | store/source/stordata.cxx | 6 | ||||
-rw-r--r-- | store/source/stordir.cxx | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/store/source/stordata.cxx b/store/source/stordata.cxx index 7ce39a9c1208..7e989bc43352 100644 --- a/store/source/stordata.cxx +++ b/store/source/stordata.cxx @@ -244,7 +244,7 @@ storeError OStoreIndirectionPageObject::read ( // Check arguments. sal_uInt16 const nLimit = rPage.capacityCount(); - if (!((nDouble < nLimit) && (nSingle < nLimit))) + if ((nDouble >= nLimit) || (nSingle >= nLimit)) return store_E_InvalidAccess; // Check single indirect page location. @@ -347,7 +347,7 @@ storeError OStoreIndirectionPageObject::write ( // Check arguments. sal_uInt16 const nLimit = rPage.capacityCount(); - if (!((nDouble < nLimit) && (nSingle < nLimit))) + if ((nDouble >= nLimit) || (nSingle >= nLimit)) return store_E_InvalidAccess; // Load or create single indirect page. @@ -462,7 +462,7 @@ storeError OStoreIndirectionPageObject::truncate ( // Check arguments. sal_uInt16 const nLimit = rPage.capacityCount(); - if (!((nDouble < nLimit) && (nSingle < nLimit))) + if ((nDouble >= nLimit) || (nSingle >= nLimit)) return store_E_InvalidAccess; // Truncate. diff --git a/store/source/stordir.cxx b/store/source/stordir.cxx index 7688194069de..80cb2efc501c 100644 --- a/store/source/stordir.cxx +++ b/store/source/stordir.cxx @@ -165,7 +165,7 @@ storeError OStoreDirectory_Impl::iterate (storeFindData &rFindData) { OStorePageLink aLink; eErrCode = m_xManager->iterate (aKey, aLink, rFindData.m_nAttrib); - if (!((eErrCode == store_E_None) && (aKey.m_nHigh == store::htonl(m_nPath)))) + if (eErrCode != store_E_None || aKey.m_nHigh != store::htonl(m_nPath)) break; if (!(rFindData.m_nAttrib & STORE_ATTRIB_ISLINK)) |