summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-28 15:13:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-29 07:17:37 +0100
commit21de55596c0fdc2be736c6d0369bd9d3783020be (patch)
tree07d0f0cd54690e54405fe574c572cb2be74a3336 /vcl/source
parentda9fb5d6d9ebf9363981c370ce937d8848989fcb (diff)
remove unnecessary "if (!empty()" checks before loops
found with git grep -n -A4 'if.*!.*empty' | grep -B3 -P '(\bfor)|(\bwhile)|(\bdo)' Change-Id: I582235b7cf977a0f9fb4099eb306fdb4a07b5334 Reviewed-on: https://gerrit.libreoffice.org/64169 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/control/notebookbar.cxx2
-rw-r--r--vcl/source/filter/ipdf/pdfdocument.cxx9
2 files changed, 4 insertions, 7 deletions
diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx
index 94740fadbcbf..f7680a07d524 100644
--- a/vcl/source/control/notebookbar.cxx
+++ b/vcl/source/control/notebookbar.cxx
@@ -147,7 +147,7 @@ void NotebookBar::SetSystemWindow(SystemWindow* pSystemWindow)
void SAL_CALL NotebookBarContextChangeEventListener::notifyContextChangeEvent(const css::ui::ContextChangeEventObject& rEvent)
{
- if (mpParent && !mpParent->m_pContextContainers.empty())
+ if (mpParent)
{
for (NotebookbarContextControl* pControl : mpParent->m_pContextContainers)
pControl->SetContext(vcl::EnumContext::GetContextEnum(rEvent.ContextName));
diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx
index 092df7cfbee7..83ecf677f1ed 100644
--- a/vcl/source/filter/ipdf/pdfdocument.cxx
+++ b/vcl/source/filter/ipdf/pdfdocument.cxx
@@ -2295,12 +2295,9 @@ size_t PDFDictionaryElement::Parse(const std::vector<std::unique_ptr<PDFElement>
auto pEndArr = dynamic_cast<PDFEndArrayElement*>(rElements[i].get());
if (pArray && pEndArr)
{
- if (!aNumbers.empty())
- {
- for (auto& pNumber : aNumbers)
- pArray->PushBack(pNumber);
- aNumbers.clear();
- }
+ for (auto& pNumber : aNumbers)
+ pArray->PushBack(pNumber);
+ aNumbers.clear();
rDictionary[aName] = pArray;
if (pThisDictionary)
{