File diff r20997:6eb354da02ee → r20998:c047af70b5bc
src/script/api/script_list.cpp
Show inline comments
 
@@ -517,15 +517,13 @@ void ScriptList::Sort(SorterType sorter,
 
				this->sorter = new ScriptListSorterValueAscending(this);
 
			} else {
 
				this->sorter = new ScriptListSorterValueDescending(this);
 
			}
 
			break;
 

	
 
		default:
 
			this->Sort(SORT_BY_ITEM, false);
 
			return;
 
		default: NOT_REACHED();
 
	}
 
	this->sorter_type    = sorter;
 
	this->sort_ascending = ascending;
 
	this->initialized    = false;
 
}
 

	
 
@@ -638,12 +636,13 @@ void ScriptList::RemoveBottom(int32 coun
 
					/* When the last item is removed from the bucket, the bucket itself is removed.
 
					 * This means that the iterators can be invalid after a call to RemoveItem.
 
					 */
 
					if (--size == 0) break;
 
				}
 
			}
 
			break;
 

	
 
		case SORT_BY_ITEM:
 
			for (ScriptListMap::reverse_iterator iter = this->items.rbegin(); iter != this->items.rend(); iter = this->items.rbegin()) {
 
				if (--count < 0) return;
 
				this->RemoveItem((*iter).first);
 
			}