diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-03-02 11:07:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-03-02 14:21:52 +0000 |
commit | ab86a53623c9bf5d3abc7149aa85d0e0c8d7fd98 (patch) | |
tree | 5457981a1a0e3b0ca4f5d6104d0105c3f5b1b7ee /sal | |
parent | cf6d0fced8bc8770ca101b71187c8d0ed28ae1f1 (diff) |
V805: Decreased performance
Change-Id: I822c5ebc321ebda87c238a1781a31793c1623e34
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/profile.cxx | 4 | ||||
-rw-r--r-- | sal/osl/w32/security.c | 15 | ||||
-rw-r--r-- | sal/qa/OStringBuffer/rtl_OStringBuffer.cxx | 2 |
3 files changed, 10 insertions, 11 deletions
diff --git a/sal/osl/w32/profile.cxx b/sal/osl/w32/profile.cxx index 199b618bdbc0..066aeed5be4f 100644 --- a/sal/osl/w32/profile.cxx +++ b/sal/osl/w32/profile.cxx @@ -2363,7 +2363,7 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str WideCharToMultiByte(CP_ACP,0, ::osl::mingw_reinterpret_cast<LPCWSTR>(aPath), -1, aTmpPath, aTmpPath.getBufSizeInSymbols(), NULL, NULL); - if ((access(aTmpPath, 0) < 0) && (strlen(Product) > 0)) + if ((access(aTmpPath, 0) < 0) && (Product[0] != '\0')) { rtl_uString * strSVFallback = NULL; rtl_uString * strSVProfile = NULL; @@ -2409,7 +2409,7 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str osl_closeProfile(hProfile); } - if (strlen(Buffer) > 0) + if (Buffer[0] != '\0') { dwPathLen = MultiByteToWideChar( CP_ACP, 0, Buffer, -1, ::osl::mingw_reinterpret_cast<LPWSTR>(aPath), aPath.getBufSizeInSymbols() ); diff --git a/sal/osl/w32/security.c b/sal/osl/w32/security.c index cc4a1b0853a7..7d19974276f8 100644 --- a/sal/osl/w32/security.c +++ b/sal/osl/w32/security.c @@ -867,16 +867,15 @@ static sal_Bool SAL_CALL getUserNameImpl(oslSecurity Security, rtl_uString **str free(pNameW); return sal_True; } - else - if (wcslen(pSecImpl->m_User) > 0) - { - rtl_uString_newFromStr( strName, pSecImpl->m_pNetResource->lpRemoteName); + else if (pSecImpl->m_User[0] != '\0') + { + rtl_uString_newFromStr(strName, pSecImpl->m_pNetResource->lpRemoteName); - if (pNameW) - free(pNameW); + if (pNameW) + free(pNameW); - return sal_True; - } + return sal_True; + } if (pNameW) free(pNameW); diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx index 707cc07d8539..c73fb88af58c 100644 --- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx +++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx @@ -1516,7 +1516,7 @@ namespace rtl_OStringBuffer ( "test empty string", pstr != 0 && - strlen(pstr) == 0 + pstr[0] == '\0' ); } |