diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-01-28 17:53:30 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-01-28 17:56:18 +0100 |
commit | cead54b6e555fe907348943b4586e956771f6ad0 (patch) | |
tree | 509e515c969fa27449fd7f7674c252e742133aae /stoc | |
parent | ed874d2eab1a6b1146f411a5a83cc790d3226f10 (diff) |
Use vector::data
...in some places where it is obvious that it does not hurt that for an empty
vector the obtained pointer is not necessarily a nullptr.
Change-Id: Id5d66b1559ca8b8955d379bcdbfae6986ef46a51
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/security/permissions.cxx | 3 | ||||
-rw-r--r-- | stoc/source/servicemanager/servicemanager.cxx | 3 | ||||
-rw-r--r-- | stoc/source/simpleregistry/simpleregistry.cxx | 9 |
3 files changed, 5 insertions, 10 deletions
diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx index 28b207abc093..85f8e02c503e 100644 --- a/stoc/source/security/permissions.cxx +++ b/stoc/source/security/permissions.cxx @@ -528,8 +528,7 @@ Sequence< OUString > PermissionCollection::toStrings() const { strings.push_back( perm->toString() ); } - return Sequence< OUString >( - strings.empty() ? 0 : &strings[ 0 ], strings.size() ); + return Sequence< OUString >( strings.data(), strings.size() ); } #endif diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx index 06bb75753203..cdf92db26d77 100644 --- a/stoc/source/servicemanager/servicemanager.cxx +++ b/stoc/source/servicemanager/servicemanager.cxx @@ -1092,8 +1092,7 @@ Sequence< Reference< XInterface > > OServiceManager::queryServiceFactories( vec.push_back( p.first->second ); ++p.first; } - ret = Sequence< Reference< XInterface > >( - vec.empty() ? 0 : &vec[ 0 ], vec.size() ); + ret = Sequence< Reference< XInterface > >( vec.data(), vec.size() ); } return ret; diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx index 3a038f371b37..12faa50b1838 100644 --- a/stoc/source/simpleregistry/simpleregistry.cxx +++ b/stoc/source/simpleregistry/simpleregistry.cxx @@ -419,8 +419,7 @@ void Key::setLongListValue(css::uno::Sequence< sal_Int32 > const & seqValue) list.push_back(seqValue[i]); } RegError err = key_.setLongListValue( - OUString(), list.empty() ? 0 : &list[0], - static_cast< sal_uInt32 >(list.size())); + OUString(), list.data(), static_cast< sal_uInt32 >(list.size())); if (err != REG_NO_ERROR) { throw css::registry::InvalidRegistryException( (("com.sun.star.registry.SimpleRegistry key setLongListValue:" @@ -608,8 +607,7 @@ void Key::setAsciiListValue( list2.push_back(const_cast< char * >(i->getStr())); } RegError err = key_.setStringListValue( - OUString(), list2.empty() ? 0 : &list2[0], - static_cast< sal_uInt32 >(list2.size())); + OUString(), list2.data(), static_cast< sal_uInt32 >(list2.size())); if (err != REG_NO_ERROR) { throw css::registry::InvalidRegistryException( (("com.sun.star.registry.SimpleRegistry key" @@ -745,8 +743,7 @@ void Key::setStringListValue( list.push_back(const_cast< sal_Unicode * >(seqValue[i].getStr())); } RegError err = key_.setUnicodeListValue( - OUString(), list.empty() ? 0 : &list[0], - static_cast< sal_uInt32 >(list.size())); + OUString(), list.data(), static_cast< sal_uInt32 >(list.size())); if (err != REG_NO_ERROR) { throw css::registry::InvalidRegistryException( (("com.sun.star.registry.SimpleRegistry key" |