summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2023-12-28 15:29:22 +0100
committerJulien Nabet <serval2412@yahoo.fr>2023-12-28 17:12:12 +0100
commitf012065d14f8dc768b1badceef488336751f4a45 (patch)
treed2308be2bc5810ef56499bedb23caf80caf1c088 /ucb
parentdf11ff317de859cad000a50999b48e6a25070be9 (diff)
Use emplace_back instead of push_back (ucb)
Change-Id: I3cef6ad53d4420d259a038058f989cbdc324fb43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161386 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/package/pkgdatasupplier.cxx4
-rw-r--r--ucb/source/ucp/webdav-curl/ContentProperties.cxx8
-rw-r--r--ucb/source/ucp/webdav-curl/webdavcontent.cxx16
3 files changed, 13 insertions, 15 deletions
diff --git a/ucb/source/ucp/package/pkgdatasupplier.cxx b/ucb/source/ucp/package/pkgdatasupplier.cxx
index 436f7023d337..1da67d26b3e9 100644
--- a/ucb/source/ucp/package/pkgdatasupplier.cxx
+++ b/ucb/source/ucp/package/pkgdatasupplier.cxx
@@ -208,7 +208,7 @@ bool DataSupplier::getResultImpl( std::unique_lock<std::mutex>& rGuard, sal_uInt
// Assemble URL for child.
OUString aURL = assembleChildURL( aName );
- m_aResults.push_back( ResultListEntry( aURL ) );
+ m_aResults.emplace_back(aURL);
if ( nPos == nIndex )
{
@@ -288,7 +288,7 @@ sal_uInt32 DataSupplier::totalCount()
// Assemble URL for child.
OUString aURL = assembleChildURL( aName );
- m_aResults.push_back( ResultListEntry( aURL ) );
+ m_aResults.emplace_back(aURL);
}
catch ( container::NoSuchElementException const & )
{
diff --git a/ucb/source/ucp/webdav-curl/ContentProperties.cxx b/ucb/source/ucp/webdav-curl/ContentProperties.cxx
index c89710a1eafb..5794282028f6 100644
--- a/ucb/source/ucp/webdav-curl/ContentProperties.cxx
+++ b/ucb/source/ucp/webdav-curl/ContentProperties.cxx
@@ -304,19 +304,19 @@ void ContentProperties::UCBNamesToHTTPNames(
if ( rProp.Name == "DateModified" )
{
- propertyNames.push_back( OUString( "Last-Modified" ) );
+ propertyNames.emplace_back("Last-Modified");
}
else if ( rProp.Name == "MediaType" )
{
- propertyNames.push_back( OUString( "Content-Type" ) );
+ propertyNames.emplace_back("Content-Type");
}
else if ( rProp.Name == "Size" )
{
- propertyNames.push_back( OUString( "Content-Length" ) );
+ propertyNames.emplace_back("Content-Length");
}
else
{
- propertyNames.push_back( rProp.Name );
+ propertyNames.emplace_back(rProp.Name);
}
}
}
diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
index 2111263bf49c..527f26e198b2 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
@@ -100,10 +100,9 @@ void lcl_sendPartialGETRequest( bool &bError,
{
DAVResource aResource;
DAVRequestHeaders aPartialGet;
- aPartialGet.push_back(
- DAVRequestHeader(
+ aPartialGet.emplace_back(
OUString( "Range" ), // see <https://tools.ietf.org/html/rfc7233#section-3.1>
- OUString( "bytes=0-0" )));
+ OUString( "bytes=0-0" ));
bool bIsRequestSize = std::any_of(aHeaderNames.begin(), aHeaderNames.end(),
[](const OUString& rHeaderName) { return rHeaderName == "Content-Length"; });
@@ -112,8 +111,8 @@ void lcl_sendPartialGETRequest( bool &bError,
{
// we need to know if the server accepts range requests for a resource
// and the range unit it uses
- aHeaderNames.push_back( OUString( "Accept-Ranges" ) ); // see <https://tools.ietf.org/html/rfc7233#section-2.3>
- aHeaderNames.push_back( OUString( "Content-Range" ) ); // see <https://tools.ietf.org/html/rfc7233#section-4.2>
+ aHeaderNames.emplace_back("Accept-Ranges"); // see <https://tools.ietf.org/html/rfc7233#section-2.3>
+ aHeaderNames.emplace_back("Content-Range"); // see <https://tools.ietf.org/html/rfc7233#section-4.2>
}
try
{
@@ -1474,7 +1473,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
// in case of not DAV PROFIND (previously in program flow) failed
// so we need to add the only prop that's common
// to DAV and NON_DAV: MediaType, that maps to Content-Type
- aHeaderNames.push_back( "Content-Type" );
+ aHeaderNames.emplace_back("Content-Type");
}
if (!aHeaderNames.empty()) try
@@ -4264,10 +4263,9 @@ bool Content::isResourceAvailable( const css::uno::Reference< css::ucb::XCommand
// do a GET with a payload of 0, the server does not
// support HEAD (or has HEAD disabled)
DAVRequestHeaders aPartialGet;
- aPartialGet.push_back(
- DAVRequestHeader(
+ aPartialGet.emplace_back(
OUString( "Range" ),
- OUString( "bytes=0-0" )));
+ OUString( "bytes=0-0" ));
rResAccess->GET0( aPartialGet,
aHeaderNames,