diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-01 17:42:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-02 13:31:19 +0200 |
commit | 1927b51993fb68907a75765676179b08ab195196 (patch) | |
tree | 1b7d09c1b5e7ea945fb6ea618a4c100e8630ebb4 /unoidl | |
parent | 0dfa444f393a5766d36fe7d2480d0c8ec832e329 (diff) |
loplugin:stringviewparam convert methods using indexOf
.. and lastIndexOf, which convert to find and rfind
Change-Id: I6c4156cf904774c0d867f85a4c2785dba7593f62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132445
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unoidl')
-rw-r--r-- | unoidl/source/legacyprovider.cxx | 4 | ||||
-rw-r--r-- | unoidl/source/unoidl-check.cxx | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx index 1d147a975582..ab99fcf59dd1 100644 --- a/unoidl/source/legacyprovider.cxx +++ b/unoidl/source/legacyprovider.cxx @@ -26,9 +26,9 @@ namespace unoidl::detail { namespace { -std::vector< OUString > translateAnnotations(OUString const & documentation) { +std::vector< OUString > translateAnnotations(std::u16string_view documentation) { std::vector< OUString > ans; - if (documentation.indexOf("@deprecated") != -1) { + if (documentation.find(u"@deprecated") != std::u16string_view::npos) { //TODO: this check is somewhat crude ans.push_back("deprecated"); } diff --git a/unoidl/source/unoidl-check.cxx b/unoidl/source/unoidl-check.cxx index 58b179ea41b0..253079024106 100644 --- a/unoidl/source/unoidl-check.cxx +++ b/unoidl/source/unoidl-check.cxx @@ -886,10 +886,10 @@ void checkMap( } } -bool valid(OUString const & identifier) { - for (sal_Int32 i = 0;; ++i) { - i = identifier.indexOf('_', i); - if (i == -1) { +bool valid(std::u16string_view identifier) { + for (size_t i = 0;; ++i) { + i = identifier.find('_', i); + if (i == std::u16string_view::npos) { return true; } if (!rtl::isAsciiUpperCase(identifier[0]) || identifier[i - 1] == '_') { |