From: <pj...@us...> - 2008-05-20 19:14:38
|
Revision: 4430 http://jython.svn.sourceforge.net/jython/?rev=4430&view=rev Author: pjenvey Date: 2008-05-20 12:14:37 -0700 (Tue, 20 May 2008) Log Message: ----------- special case symmetric_difference_update on yourself; just clear avoids ConcurrentModificationExceptions Modified Paths: -------------- trunk/jython/src/org/python/core/PySet.java Modified: trunk/jython/src/org/python/core/PySet.java =================================================================== --- trunk/jython/src/org/python/core/PySet.java 2008-05-20 19:01:14 UTC (rev 4429) +++ trunk/jython/src/org/python/core/PySet.java 2008-05-20 19:14:37 UTC (rev 4430) @@ -281,6 +281,11 @@ @ExposedMethod final void set_symmetric_difference_update(PyObject other) { + if (this == other) { + set_clear(); + return; + } + BaseSet bs = (other instanceof BaseSet) ? (BaseSet) other : new PySet(other); for (Iterator iterator = bs._set.iterator(); iterator.hasNext();) { Object o = iterator.next(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |