Bug 1216994 - Correctly delete structure for empty folders.
Bug 1216994 - Correctly delete structure for empty folders.

Previously, we computed new child structure rows, then figured out which
parents to delete-then-insert by looking at those rows.

This omitted parents that now had no children -- they contribute no new
child structure rows.

I cleaned this up: now we delete the structure rows of deleted items and
all folders in one pass. Things get a lot simpler, performance improves,
and it corrects this bug.

Tests to come, I hope.

HongliYu/firefox-ios,tecgirl/firefox-ios,flodolo/firefox-ios,radazzouz/firefox-ios,justindarc/firefox-ios,luoziyong/firefox-ios,doronkatz/firefox-ios,mshhmzh/firefox-ios,farhanpatel/firefox-ios,Acidburn0zzz/firefox-ios,StYaphet/firefox-ios,cliqz-oss/browser-ios,varkor/firefox-ios,thebnich/firefox-ios,kesun421/firefox-ios,Bunn/firefox-ios,SuPair/firefox-ios,st3fan/firefox-ios,brave/browser-ios,DarrenKong/firefox-ios,Acidburn0zzz/firefox-ios,Johennes/firefox-ios,mshhmzh/firefox-ios,kesun421/firefox-ios,aaronraimist/firefox-ios,mauryat/firefox-ios,flodolo/firefox-ios,ncalexan/firefox-ios,Johennes/firefox-ios,eoger/firefox-ios,doronkatz/firefox-ios,serbomjack/Firefox-for-windows-10-mobile,Ehrippura/firefox-ios,SuPair/firefox-ios,reza-ryte-club/firefox-ios,Ehrippura/firefox-ios,justindarc/firefox-ios,varkor/firefox-ios,matthewpurcell/firefox-ios,Allow2CEO/browser-ios,mauryat/firefox-ios,sharath-cliqz/browser-ios,mozilla-mobile/firefox-ios,sachin004/firefox-ios,alessiobrozzi/firefox-ios,Allow2CEO/browser-ios,HongliYu/firefox-ios,serbomjack/Firefox-for-windows-10-mobile,Bunn/firefox-ios,ilhanadiyaman/firefox-ios,mshhmzh/firefox-ios,ncalexan/firefox-ios,AaronMT/firefox-ios,Johennes/firefox-ios,aaronraimist/firefox-ios,justindarc/firefox-ios,eoger/firefox-ios,farhanpatel/firefox-ios,justindarc/firefox-ios,ncalexan/firefox-ios,sachin004/firefox-ios,mauryat/firefox-ios,jacobwhite/firefox-ios,Ehrippura/firefox-ios,tecgirl/firefox-ios,DarrenKong/firefox-ios,luoziyong/firefox-ios,jacobwhite/firefox-ios,Bunn/firefox-ios,HongliYu/firefox-ios,ncalexan/firefox-ios,brave/browser-ios,sharath-cliqz/browser-ios,ilhanadiyaman/firefox-ios,serbomjack/Firefox-for-windows-10-mobile,aaronraimist/firefox-ios,matthewpurcell/firefox-ios,shorlander/firefox-ios,Ehrippura/firefox-ios,thebnich/firefox-ios,vbudhram/firefox-ios,garvankeeley/firefox-ios,Bunn/firefox-ios,tecgirl/firefox-ios,hgl888/firefox-ios,mozilla-mobile/firefox-ios,varkor/firefox-ios,serbomjack/Firefox-for-windows-10-mobile,eoger/firefox-ios,sachin004/firefox-ios,mkaply/firefox-ios,thebnich/firefox-ios,alessiobrozzi/firefox-ios,Johennes/firefox-ios,Allow2CEO/browser-ios,eoger/firefox-ios,vbudhram/firefox-ios,justindarc/firefox-ios,SuPair/firefox-ios,reza-ryte-club/firefox-ios,Acidburn0zzz/firefox-ios,DarrenKong/firefox-ios,hgl888/firefox-ios,matthewpurcell/firefox-ios,eoger/firefox-ios,reza-ryte-club/firefox-ios,Bunn/firefox-ios,Acidburn0zzz/firefox-ios,mkaply/firefox-ios,ilhanadiyaman/firefox-ios,shorlander/firefox-ios,brave/browser-ios,SuPair/firefox-ios,flodolo/firefox-ios,mauryat/firefox-ios,mshhmzh/firefox-ios,farhanpatel/firefox-ios,mkaply/firefox-ios,Acidburn0zzz/firefox-ios,st3fan/firefox-ios,Ehrippura/firefox-ios,thebnich/firefox-ios,matthewpurcell/firefox-ios,SuPair/firefox-ios,garvankeeley/firefox-ios,aaronraimist/firefox-ios,sachin004/firefox-ios,brave/browser-ios,Allow2CEO/browser-ios,varkor/firefox-ios,hgl888/firefox-ios,AaronMT/firefox-ios,luoziyong/firefox-ios,farhanpatel/firefox-ios,sharath-cliqz/browser-ios,matthewpurcell/firefox-ios,reza-ryte-club/firefox-ios,jacobwhite/firefox-ios,Allow2CEO/browser-ios,jacobwhite/firefox-ios,st3fan/firefox-ios,SuPair/firefox-ios,DarrenKong/firefox-ios,cliqz-oss/browser-ios,ilhanadiyaman/firefox-ios,serbomjack/Firefox-for-windows-10-mobile,StYaphet/firefox-ios,ilhanadiyaman/firefox-ios,StYaphet/firefox-ios,cliqz-oss/browser-ios,thebnich/firefox-ios,ncalexan/firefox-ios,mkaply/firefox-ios,Johennes/firefox-ios,garvankeeley/firefox-ios,sachin004/firefox-ios,tecgirl/firefox-ios,mkaply/firefox-ios,kesun421/firefox-ios,SuPair/firefox-ios,garvankeeley/firefox-ios,reza-ryte-club/firefox-ios,eoger/firefox-ios,shorlander/firefox-ios,hgl888/firefox-ios,Acidburn0zzz/firefox-ios,varkor/firefox-ios,mkaply/firefox-ios,st3fan/firefox-ios,mauryat/firefox-ios,StYaphet/firefox-ios,varkor/firefox-ios,mshhmzh/firefox-ios,cliqz-oss/browser-ios,Johennes/firefox-ios,kesun421/firefox-ios,HongliYu/firefox-ios,ncalexan/firefox-ios,luoziyong/firefox-ios,kesun421/firefox-ios,mauryat/firefox-ios,Bunn/firefox-ios,AaronMT/firefox-ios,luoziyong/firefox-ios,farhanpatel/firefox-ios,tecgirl/firefox-ios,vbudhram/firefox-ios,st3fan/firefox-ios,st3fan/firefox-ios,matthewpurcell/firefox-ios,flodolo/firefox-ios,doronkatz/firefox-ios,serbomjack/Firefox-for-windows-10-mobile,HongliYu/firefox-ios,varkor/firefox-ios,thebnich/firefox-ios,brave/browser-ios,cliqz-oss/browser-ios,kesun421/firefox-ios,Ehrippura/firefox-ios,Acidburn0zzz/firefox-ios,farhanpatel/firefox-ios,flodolo/firefox-ios,matthewpurcell/firefox-ios,jacobwhite/firefox-ios,hgl888/firefox-ios,flodolo/firefox-ios,ncalexan/firefox-ios,flodolo/firefox-ios,hgl888/firefox-ios,garvankeeley/firefox-ios,mshhmzh/firefox-ios,HongliYu/firefox-ios,justindarc/firefox-ios,cliqz-oss/browser-ios,mozilla-mobile/firefox-ios,radazzouz/firefox-ios,radazzouz/firefox-ios,sharath-cliqz/browser-ios,HongliYu/firefox-ios,brave/browser-ios,hgl888/firefox-ios,reza-ryte-club/firefox-ios,brave/browser-ios,shorlander/firefox-ios,mozilla-mobile/firefox-ios,alessiobrozzi/firefox-ios,alessiobrozzi/firefox-ios,farhanpatel/firefox-ios,AaronMT/firefox-ios,Allow2CEO/browser-ios,doronkatz/firefox-ios,justindarc/firefox-ios,sachin004/firefox-ios,sharath-cliqz/browser-ios,Johennes/firefox-ios,tecgirl/firefox-ios,garvankeeley/firefox-ios,thebnich/firefox-ios,shorlander/firefox-ios,AaronMT/firefox-ios,mkaply/firefox-ios,Allow2CEO/browser-ios,mozilla-mobile/firefox-ios,DarrenKong/firefox-ios,matthewpurcell/firefox-ios,radazzouz/firefox-ios,alessiobrozzi/firefox-ios,ilhanadiyaman/firefox-ios,kesun421/firefox-ios,Bunn/firefox-ios,luoziyong/firefox-ios,luoziyong/firefox-ios,sachin004/firefox-ios,ilhanadiyaman/firefox-ios,st3fan/firefox-ios,Acidburn0zzz/firefox-ios,varkor/firefox-ios,aaronraimist/firefox-ios,serbomjack/Firefox-for-windows-10-mobile,DarrenKong/firefox-ios,sharath-cliqz/browser-ios,cliqz-oss/browser-ios,shorlander/firefox-ios,jacobwhite/firefox-ios,Johennes/firefox-ios,shorlander/firefox-ios,radazzouz/firefox-ios,mshhmzh/firefox-ios,mshhmzh/firefox-ios,doronkatz/firefox-ios,thebnich/firefox-ios,sharath-cliqz/browser-ios,DarrenKong/firefox-ios,garvankeeley/firefox-ios,radazzouz/firefox-ios,reza-ryte-club/firefox-ios,sharath-cliqz/browser-ios,Ehrippura/firefox-ios,tecgirl/firefox-ios,mauryat/firefox-ios,AaronMT/firefox-ios,eoger/firefox-ios,alessiobrozzi/firefox-ios,vbudhram/firefox-ios,StYaphet/firefox-ios,radazzouz/firefox-ios,brave/browser-ios,aaronraimist/firefox-ios,reza-ryte-club/firefox-ios,serbomjack/Firefox-for-windows-10-mobile,aaronraimist/firefox-ios,mozilla-mobile/firefox-ios,sachin004/firefox-ios,doronkatz/firefox-ios,ilhanadiyaman/firefox-ios,mozilla-mobile/firefox-ios,StYaphet/firefox-ios,vbudhram/firefox-ios,vbudhram/firefox-ios,StYaphet/firefox-ios,alessiobrozzi/firefox-ios,hgl888/firefox-ios,Allow2CEO/browser-ios,aaronraimist/firefox-ios,AaronMT/firefox-ios,cliqz-oss/browser-ios,brave/browser-ios,vbudhram/firefox-ios,st3fan/firefox-ios,doronkatz/firefox-ios,StYaphet/firefox-ios,tecgirl/firefox-ios,jacobwhite/firefox-ios