src/common/js/winjs/js/ui.js
function removeMirageIndices(countMax, indexFirstKnown) {
                    var placeholdersAtEnd = 0;

                    function removePlaceholdersAfterSlot(slotRemoveAfter) {
                        for (var slot2 = slotListEnd.prev; !(slot2.index < countMax) && slot2 !== slotRemoveAfter;) {
                            var slotPrev2 = slot2.prev;
                            if (slot2.index !== undefined) {
                                deleteSlot(slot2, true);
                            }
                            slot2 = slotPrev2;
                        }

                        placeholdersAtEnd = 0;
                    }

                    for (var slot = slotListEnd.prev; !(slot.index < countMax) || placeholdersAtEnd > 0;) {
                        var slotPrev = slot.prev;

                        if (slot === slotsStart) {
                            removePlaceholdersAfterSlot(slotsStart);
                            break;
                        } else if (slot.key) {
                            if (slot.index >= countMax) {
                                beginRefresh();
                                return false;
                            } else if (slot.index >= indexFirstKnown) {
                                removePlaceholdersAfterSlot(slot);
                            } else {
                                if (itemsFromKey) {
                                    fetchItemsFromKey(slot, 0, placeholdersAtEnd);
                                } else {
                                    fetchItemsFromIndex(slot, 0, placeholdersAtEnd);
                                }

                                // Wait until the fetch has completed before doing anything
                                return false;
                            }
                        } else if (slot.indexRequested || slot.firstInSequence) {
                            removePlaceholdersAfterSlot(slotPrev);
                        } else {
                            placeholdersAtEnd++;
                        }

                        slot = slotPrev;
                    }

                    return true;
                }
function removeMirageIndices(countMax, indexFirstKnown) {
                    var placeholdersAtEnd = 0;

                    function removePlaceholdersAfterSlot(slotRemoveAfter) {
                        for (var slot2 = slotListEnd.prev; !(slot2.index < countMax) && slot2 !== slotRemoveAfter;) {
                            var slotPrev2 = slot2.prev;
                            if (slot2.index !== undefined) {
                                deleteSlot(slot2, true);
                            }
                            slot2 = slotPrev2;
                        }

                        placeholdersAtEnd = 0;
                    }

                    for (var slot = slotListEnd.prev; !(slot.index < countMax) || placeholdersAtEnd > 0;) {
                        var slotPrev = slot.prev;

                        if (slot === slotsStart) {
                            removePlaceholdersAfterSlot(slotsStart);
                            break;
                        } else if (slot.key) {
                            if (slot.index >= countMax) {
                                beginRefresh();
                                return false;
                            } else if (slot.index >= indexFirstKnown) {
                                removePlaceholdersAfterSlot(slot);
                            } else {
                                if (itemsFromKey) {
                                    fetchItemsFromKey(slot, 0, placeholdersAtEnd);
                                } else {
                                    fetchItemsFromIndex(slot, 0, placeholdersAtEnd);
                                }

                                // Wait until the fetch has completed before doing anything
                                return false;
                            }
                        } else if (slot.indexRequested || slot.firstInSequence) {
                            removePlaceholdersAfterSlot(slotPrev);
                        } else {
                            placeholdersAtEnd++;
                        }

                        slot = slotPrev;
                    }

                    return true;
                }
function removeMirageIndices ( countMax , indexFirstKnown ) { var placeholdersAtEnd = 0 ; function removePlaceholdersAfterSlot ( slotRemoveAfter ) { for ( var slot2 = slotListEnd . prev ; ! ( slot2 . index < countMax ) && slot2 !== slotRemoveAfter ; ) { var slotPrev2 = slot2 . prev ; if ( slot2 . index !== undefined ) { deleteSlot ( slot2 , true ) ; } slot2 = slotPrev2 ; } placeholdersAtEnd = 0 ; } for ( var slot = slotListEnd . prev ; ! ( slot . index < countMax ) || placeholdersAtEnd > 0 ; ) { var slotPrev = slot . prev ; if ( slot === slotsStart ) { removePlaceholdersAfterSlot ( slotsStart ) ; break ; } else if ( slot . key ) { if ( slot . index >= countMax ) { beginRefresh ( ) ; return false ; } else if ( slot . index >= indexFirstKnown ) { removePlaceholdersAfterSlot ( slot ) ; } else { if ( itemsFromKey ) { fetchItemsFromKey ( slot , 0 , placeholdersAtEnd ) ; } else { fetchItemsFromIndex ( slot , 0 , placeholdersAtEnd ) ; } // Wait until the fetch has completed before doing anything return false ; } } else if ( slot . indexRequested || slot . firstInSequence ) { removePlaceholdersAfterSlot ( slotPrev ) ; } else { placeholdersAtEnd ++ ; } slot = slotPrev ; } return true ; }
Removes any placeholders with indices that exceed the given upper bound on the count
Removes any placeholders with indices that exceed the given upper bound on the count