From: <ha...@us...> - 2013-02-10 00:08:51
|
Revision: 17919 http://jmol.svn.sourceforge.net/jmol/?rev=17919&view=rev Author: hansonr Date: 2013-02-10 00:08:44 +0000 (Sun, 10 Feb 2013) Log Message: ----------- sets atomCount in JmolMolecule earlier Modified Paths: -------------- trunk/Jmol/src/org/jmol/util/JmolMolecule.java Modified: trunk/Jmol/src/org/jmol/util/JmolMolecule.java =================================================================== --- trunk/Jmol/src/org/jmol/util/JmolMolecule.java 2013-02-09 23:30:56 UTC (rev 17918) +++ trunk/Jmol/src/org/jmol/util/JmolMolecule.java 2013-02-10 00:08:44 UTC (rev 17919) @@ -191,6 +191,7 @@ jm.nodes = nodes; jm.firstAtomIndex = firstAtomIndex; jm.atomList = atomList; + jm.atomCount = atomList.cardinality(); jm.moleculeIndex = moleculeIndex; jm.modelIndex = modelIndex; jm.indexInModel = indexInModel; @@ -204,9 +205,8 @@ } elementCounts = new int[Elements.elementNumberMax]; altElementCounts = new int[Elements.altElementMax]; - int count = 0; + atomCount = atomList.cardinality(); for (int i = atomList.nextSetBit(0); i >= 0; i = atomList.nextSetBit(i + 1)) { - count++; int n = nodes[i].getAtomicAndIsotopeNumber(); if (n < Elements.elementNumberMax) { elementCounts[n]++; @@ -229,7 +229,6 @@ altElementMax = Math.max(altElementMax, n); } } - atomCount = count; } private static boolean getCovalentlyConnectedBitSet(JmolNode[] atoms, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |