while (elements.hasNext()) {
Object element = elements.next();
if (!(element instanceof AWEncodedString)) {
AWResponseBuffer childBuffer = (AWResponseBuffer)element;
if (childBuffer._type == Type.ScopeChild) {
AWEncodedString childBufferName = childBuffer._name;
AWResponseBuffer otherChildBuffer = (AWResponseBuffer)otherScopeChildren.get(childBufferName);
if (otherChildBuffer == null) {
if (inserts == null) inserts = ListUtil.list();
inserts.add(previousChild);
inserts.add(childBuffer);
total++;
} else if (!childBuffer.isEqual(otherChildBuffer) || childBuffer._alwaysRender) {
if (updates == null) updates = ListUtil.list();
updates.add(childBuffer);
total++;
}
elements.skipTo(childBuffer._contentsEndIndex);
previousChild = childBuffer;
}
}
}
elements.release();
// deletions
AWResponseBuffer otherChildBuffer = otherBuffer._children;
while (otherChildBuffer != null) {
if (otherChildBuffer._type == Type.ScopeChild) {
AWEncodedString otherChildBufferName = otherChildBuffer._name;
if (_globalScopeChildren.get(otherChildBufferName) == null) {
if (deletes == null) deletes = ListUtil.list();
deletes.add(otherChildBuffer);
total++;
}