src/common/js/winjs/js/ui.js
function updateIndices() {
                    var slot,
                        slotFirstInSequence,
                        indexNew;

                    for (slot = slotsStart; ; slot = slot.next) {
                        if (slot.firstInSequence) {
                            slotFirstInSequence = slot;
                            if (slot.indexNew !== undefined) {
                                indexNew = slot.indexNew;
                                delete slot.indexNew;
                                if (isNaN(indexNew)) {
                                    break;
                                }
                            } else {
                                indexNew = slot.index;
                            }

                            // See if this sequence should be merged with the previous one
                            if (slot !== slotsStart && slot.prev.index === indexNew - 1) {
                                mergeSequences(slot.prev);
                            }
                        }

                        if (slot.lastInSequence) {
                            var index = indexNew;
                            for (var slotUpdate = slotFirstInSequence; slotUpdate !== slot.next; slotUpdate = slotUpdate.next) {
                                if (index !== slotUpdate.index) {
                                    changeSlotIndex(slotUpdate, index);
                                }
                                if (+index === index) {
                                    index++;
                                }
                            }
                        }

                        if (slot === slotListEnd) {
                            break;
                        }
                    }

                    // Clear any indices on slots that were moved adjacent to slots without indices
                    for (; slot !== slotsEnd; slot = slot.next) {
                        if (slot.index !== undefined && slot !== slotListEnd) {
                            changeSlotIndex(slot, undefined);
                        }
                    }

                    indexUpdateDeferred = false;

                    if (countDelta && +knownCount === knownCount) {
                        if (getCountPromise) {
                            getCountPromise.reset();
                        } else {
                            changeCount(knownCount + countDelta);
                        }

                        countDelta = 0;
                    }
                }
function updateIndices() {
                    var slot,
                        slotFirstInSequence,
                        indexNew;

                    for (slot = slotsStart; ; slot = slot.next) {
                        if (slot.firstInSequence) {
                            slotFirstInSequence = slot;
                            if (slot.indexNew !== undefined) {
                                indexNew = slot.indexNew;
                                delete slot.indexNew;
                                if (isNaN(indexNew)) {
                                    break;
                                }
                            } else {
                                indexNew = slot.index;
                            }

                            // See if this sequence should be merged with the previous one
                            if (slot !== slotsStart && slot.prev.index === indexNew - 1) {
                                mergeSequences(slot.prev);
                            }
                        }

                        if (slot.lastInSequence) {
                            var index = indexNew;
                            for (var slotUpdate = slotFirstInSequence; slotUpdate !== slot.next; slotUpdate = slotUpdate.next) {
                                if (index !== slotUpdate.index) {
                                    changeSlotIndex(slotUpdate, index);
                                }
                                if (+index === index) {
                                    index++;
                                }
                            }
                        }

                        if (slot === slotListEnd) {
                            break;
                        }
                    }

                    // Clear any indices on slots that were moved adjacent to slots without indices
                    for (; slot !== slotsEnd; slot = slot.next) {
                        if (slot.index !== undefined && slot !== slotListEnd) {
                            changeSlotIndex(slot, undefined);
                        }
                    }

                    indexUpdateDeferred = false;

                    if (countDelta && +knownCount === knownCount) {
                        if (getCountPromise) {
                            getCountPromise.reset();
                        } else {
                            changeCount(knownCount + countDelta);
                        }

                        countDelta = 0;
                    }
                }
function updateIndices ( ) { var slot , slotFirstInSequence , indexNew ; for ( slot = slotsStart ; ; slot = slot . next ) { if ( slot . firstInSequence ) { slotFirstInSequence = slot ; if ( slot . indexNew !== undefined ) { indexNew = slot . indexNew ; delete slot . indexNew ; if ( isNaN ( indexNew ) ) { break ; } } else { indexNew = slot . index ; } // See if this sequence should be merged with the previous one if ( slot !== slotsStart && slot . prev . index === indexNew - 1 ) { mergeSequences ( slot . prev ) ; } } if ( slot . lastInSequence ) { var index = indexNew ; for ( var slotUpdate = slotFirstInSequence ; slotUpdate !== slot . next ; slotUpdate = slotUpdate . next ) { if ( index !== slotUpdate . index ) { changeSlotIndex ( slotUpdate , index ) ; } if ( + index === index ) { index ++ ; } } } if ( slot === slotListEnd ) { break ; } } // Clear any indices on slots that were moved adjacent to slots without indices for ( ; slot !== slotsEnd ; slot = slot . next ) { if ( slot . index !== undefined && slot !== slotListEnd ) { changeSlotIndex ( slot , undefined ) ; } } indexUpdateDeferred = false ; if ( countDelta && + knownCount === knownCount ) { if ( getCountPromise ) { getCountPromise . reset ( ) ; } else { changeCount ( knownCount + countDelta ) ; } countDelta = 0 ; } }
Adjust the indices of all slots to be consistent with any indexNew properties, and strip off the indexNews
Adjust the indices of all slots to be consistent with any indexNew properties and strip off the indexNews