diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-02-22 12:59:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-03-08 07:06:13 +0100 |
commit | 7840effb1d5efd1fd7f6798c7c504b05292a7793 (patch) | |
tree | 845e03d4c2cfad1d5bbcaaf9dc3ec1aeece7c864 /connectivity/source/drivers | |
parent | bf35f2b36fc00f9b37397422b2ee425c6a697540 (diff) |
use more string_view
found by tweaking the stringview loplugin
Change-Id: I92203ba99642bef7951ffa146184c5562cb31d09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163744
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_tools.cxx | 18 | ||||
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_tools.hxx | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx index 29e3584aacb6..fb42f864f97e 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.cxx +++ b/connectivity/source/drivers/postgresql/pq_tools.cxx @@ -840,17 +840,17 @@ OUString getColExprForDefaultSettingVal(ConnectionSettings const *settings) OUString("pg_get_expr(pg_attrdef.adbin, pg_attrdef.adrelid, true)"); } -css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str ) +css::uno::Sequence< sal_Int32 > string2intarray( std::u16string_view str ) { css::uno::Sequence< sal_Int32 > ret; - const sal_Int32 strlen = str.getLength(); - if( str.getLength() > 1 ) + const sal_Int32 strlen = str.size(); + if( strlen > 1 ) { sal_Int32 start = 0; sal_uInt32 c; for (;;) { - c = str.iterateCodePoints(&start); + c = o3tl::iterateCodePoints(str, &start); if (!iswspace(c)) break; if ( start == strlen) @@ -860,7 +860,7 @@ css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str ) return ret; for (;;) { - c = str.iterateCodePoints(&start); + c = o3tl::iterateCodePoints(str, &start); if ( !iswspace(c) ) break; if ( start == strlen) @@ -879,7 +879,7 @@ css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str ) break; if ( start == strlen) return ret; - c=str.iterateCodePoints(&start); + c = o3tl::iterateCodePoints(str, &start); } while ( c ); do { @@ -888,7 +888,7 @@ css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str ) if ( start == strlen) return ret; digits.append(OUString(&c, 1)); - c = str.iterateCodePoints(&start); + c = o3tl::iterateCodePoints(str, &start); } while ( c ); vec.push_back( o3tl::toInt32(digits) ); do @@ -897,11 +897,11 @@ css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str ) break; if ( start == strlen) return ret; - c = str.iterateCodePoints(&start); + c = o3tl::iterateCodePoints(str, &start); } while ( c ); if ( c == L'}' ) break; - if ( str.iterateCodePoints(&start) != L',' ) + if ( o3tl::iterateCodePoints(str, &start) != L',' ) return ret; if ( start == strlen) return ret; diff --git a/connectivity/source/drivers/postgresql/pq_tools.hxx b/connectivity/source/drivers/postgresql/pq_tools.hxx index 8a31e207cc1b..c5f9174111ca 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.hxx +++ b/connectivity/source/drivers/postgresql/pq_tools.hxx @@ -131,7 +131,7 @@ void fillAttnum2attnameMap( const OUString &schema, const OUString &table ); -css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str ); +css::uno::Sequence< sal_Int32 > string2intarray( std::u16string_view str ); css::uno::Sequence< OUString > convertMappedIntArray2StringArray( const Int2StringMap &map, const css::uno::Sequence< sal_Int32> &source ); |