summaryrefslogtreecommitdiff
path: root/pyuno
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-11-29 17:19:43 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-11-29 17:19:43 +0100
commit542174a24e00ab81430a4028f49222dddb3e284f (patch)
tree0b151902f48ec62b94d36c52e18a232f28633b10 /pyuno
parent34dda497cdf0b131381c5d728a89343455d9c7d8 (diff)
Rewrite some (trivial) assignments inside if/while conditions: pyuno
Change-Id: I01ce742c727c66577d747e441a3794c1743f24ce
Diffstat (limited to 'pyuno')
-rw-r--r--pyuno/source/module/pyuno.cxx3
-rw-r--r--pyuno/source/module/pyuno_runtime.cxx3
2 files changed, 3 insertions, 3 deletions
diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx
index 8c53f7464a4f..e94309def148 100644
--- a/pyuno/source/module/pyuno.cxx
+++ b/pyuno/source/module/pyuno.cxx
@@ -1338,8 +1338,7 @@ int PyUNO_contains( PyObject *self, PyObject *pKey )
PyRef rIterator( PyUNO_iter( self ), SAL_NO_ACQUIRE );
if ( rIterator.is() )
{
- PyObject* pItem;
- while ( (pItem = PyIter_Next( rIterator.get() )) )
+ while ( PyObject* pItem = PyIter_Next( rIterator.get() ) )
{
PyRef rItem( pItem, SAL_NO_ACQUIRE );
if ( PyObject_RichCompareBool( pKey, rItem.get(), Py_EQ ) == 1 )
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx
index 4dd532ff30c3..c4b5aa9a018c 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -630,8 +630,9 @@ bool Runtime::pyIterUnpack( PyObject *const pObj, Any &a ) const
{
PyRef rItem( pItem, SAL_NO_ACQUIRE );
items.push_back( pyObject2Any( rItem.get() ) );
+ pItem = PyIter_Next( pObj );
}
- while( (pItem = PyIter_Next( pObj )) );
+ while( pItem );
a <<= comphelper::containerToSequence(items);
return true;
}