Core: Fixed inefficiency in Vector::SetCountR (and thus in Vector::At)

git-svn-id: svn://ultimatepp.org/upp/trunk@1563 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-09-07 08:37:38 +00:00
parent 44dfbbb182
commit feb49215a6
2 changed files with 1 additions and 2 deletions

View file

@ -162,7 +162,7 @@ void Vector<T>::SetCount(int n, const T& init) {
template <class T>
void Vector<T>::SetCountR(int n) {
Chk();
if(n + items > alloc)
if(n > alloc)
ReAllocF(alloc + ntl_max(alloc, n - items));
SetCount(n);
}

View file

@ -1755,7 +1755,6 @@ void ArrayCtrl::Add() {
InvalidateCache(i);
RefreshRow(i);
}
}
void ArrayCtrl::Add(const Vector<Value>& v)