diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-15 16:47:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-15 21:33:17 +0200 |
commit | 65e846d73c023cb8ed8a8393a91032d4a816f2a0 (patch) | |
tree | 39ffe06f469d5d88ce7817338e359fff11f0210c /jvmfwk/plugins | |
parent | 15d8762dd07289447e782a3812dfd4425fe9a82b (diff) |
use more string_view in jvmfwk
Change-Id: I05f3b171578b8fef5b15dcbbf10ae9b7cf2d1b02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133075
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'jvmfwk/plugins')
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 6 | ||||
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/util.hxx | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index f7d786007544..b596e18cf480 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -1023,10 +1023,10 @@ Reference<VendorBase> createInstance(createInstance_func pFunc, return aBase; } -inline OUString getDirFromFile(const OUString& usFilePath) +inline OUString getDirFromFile(std::u16string_view usFilePath) { - sal_Int32 index = usFilePath.lastIndexOf('/'); - return usFilePath.copy(0, index); + size_t index = usFilePath.rfind('/'); + return OUString(usFilePath.substr(0, index)); } void addJavaInfosFromPath( diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx index 78df074f9de3..9ba0055832ed 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx @@ -37,7 +37,7 @@ void addJREInfoFromBinPath( const OUString& path, std::vector<rtl::Reference<VendorBase>> & allInfos, std::vector<rtl::Reference<VendorBase>> & addedInfos); -inline OUString getDirFromFile(const OUString& usFilePath); +inline OUString getDirFromFile(std::u16string_view usFilePath); void addJavaInfosFromPath( std::vector<rtl::Reference<VendorBase>> & allInfos, std::vector<rtl::Reference<VendorBase>> & addedInfos); |