summaryrefslogtreecommitdiff
path: root/sal/rtl/uri.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-06 10:47:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-12 10:11:34 +0200
commit992a33313046f4a4d322db9464c474e7429a019a (patch)
tree494143e3070af872027ecaca840516d3101a881c /sal/rtl/uri.cxx
parent77c1431ee88ab04a9ff48b849acedee6d455bafb (diff)
clang-tidy: readability-else-after-return
run it against sal,cppu,cppuhelper I had to run this multiple times to catch all the cases in each module, and it requires some hand-tweaking of the resulting output - clang-tidy is not very good about cleaning up trailing spaces, and aligning things nicely. Change-Id: I00336345f5f036e12422b98d66526509380c497a Reviewed-on: https://gerrit.libreoffice.org/36194 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/rtl/uri.cxx')
-rw-r--r--sal/rtl/uri.cxx19
1 files changed, 8 insertions, 11 deletions
diff --git a/sal/rtl/uri.cxx b/sal/rtl/uri.cxx
index b00dfb99f472..91653f6cdabe 100644
--- a/sal/rtl/uri.cxx
+++ b/sal/rtl/uri.cxx
@@ -176,7 +176,7 @@ sal_uInt32 readUcs4(sal_Unicode const ** pBegin, sal_Unicode const * pEnd,
return nDstSize == 1
? aDst[0] : rtl::combineSurrogates(aDst[0], aDst[1]);
}
- else if (nInfo == RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOSMALL
+ if (nInfo == RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOSMALL
&& pEnd - p >= 3 && p[0] == cEscapePrefix
&& (nWeight1 = getHexWeight(p[1])) >= 0
&& (nWeight2 = getHexWeight(p[2])) >= 0)
@@ -202,13 +202,11 @@ sal_uInt32 readUcs4(sal_Unicode const ** pBegin, sal_Unicode const * pEnd,
}
return nChar;
}
- else
- {
- *pType = EscapeNo;
- return rtl::isHighSurrogate(nChar) && *pBegin < pEnd
- && rtl::isLowSurrogate(**pBegin) ?
- rtl::combineSurrogates(nChar, *(*pBegin)++) : nChar;
- }
+
+ *pType = EscapeNo;
+ return rtl::isHighSurrogate(nChar) && *pBegin < pEnd
+ && rtl::isLowSurrogate(**pBegin) ?
+ rtl::combineSurrogates(nChar, *(*pBegin)++) : nChar;
}
void writeUcs4(rtl_uString ** pBuffer, sal_Int32 * pCapacity, sal_uInt32 nUtf32)
@@ -305,9 +303,8 @@ bool writeEscapeChar(rtl_uString ** pBuffer, sal_Int32 * pCapacity,
} else {
if (bStrict) {
return false;
- } else {
- writeUcs4(pBuffer, pCapacity, nUtf32);
}
+ writeUcs4(pBuffer, pCapacity, nUtf32);
}
}
return true;
@@ -359,7 +356,7 @@ void parseUriRef(rtl_uString const * pUriRef, Components * pComponents)
pPos = p;
break;
}
- else if (!rtl::isAsciiAlphanumeric(*p) && *p != '+' && *p != '-'
+ if (!rtl::isAsciiAlphanumeric(*p) && *p != '+' && *p != '-'
&& *p != '.')
{
break;