diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-03 10:34:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-17 10:27:33 +0200 |
commit | 33bd16b344e273c427091ee68e946bf67b371dd7 (patch) | |
tree | 85fb383ea8e3d30f393bb197b5c74f73f6ca247f /sal/cppunittester | |
parent | fe597a337914decd62480d3eba84258333116db9 (diff) |
loplugin:stringviewparam convert methods using copy()
which converts to std::string_view::substr()
Change-Id: I3f42213b41a97e77ddcc79d84d512f49d68ca559
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132729
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/cppunittester')
-rw-r--r-- | sal/cppunittester/cppunittester.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx index ae77bb3e3961..fec62c261260 100644 --- a/sal/cppunittester/cppunittester.cxx +++ b/sal/cppunittester/cppunittester.cxx @@ -357,16 +357,16 @@ double get_time(timeval* time) return nTime; } -OString generateTestName(const OUString& rPath) +OString generateTestName(std::u16string_view rPath) { - sal_Int32 nPathSep = rPath.lastIndexOf("/"); - OUString aTestName = rPath.copy(nPathSep+1); + size_t nPathSep = rPath.rfind('/'); + std::u16string_view aTestName = rPath.substr(nPathSep+1); return OUStringToOString(aTestName, RTL_TEXTENCODING_UTF8); } -void reportResourceUsage(const OUString& rPath) +void reportResourceUsage(std::u16string_view rPath) { - OUString aFullPath = rPath + ".resource.log"; + OUString aFullPath = OUString::Concat(rPath) + ".resource.log"; rusage resource_usage; getrusage(RUSAGE_SELF, &resource_usage); |