diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-02-18 20:45:17 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-02-22 17:12:15 (GMT) |
commit | 422f353135dc8a6b3694a7f0994429df7695d4bf (patch) | |
tree | 429d2ecd449885607968fc19a78130256c455886 /src | |
parent | 8b1b4b370c98c4c574123dd754d9628c90c9b3f6 (diff) | |
download | Qt-422f353135dc8a6b3694a7f0994429df7695d4bf.zip Qt-422f353135dc8a6b3694a7f0994429df7695d4bf.tar.gz Qt-422f353135dc8a6b3694a7f0994429df7695d4bf.tar.bz2 |
remove more pointless recalculations
Reviewed-by: joao
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qlist.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index ac0dc46..1576b40 100644 --- a/src/corelib/tools/qlist.cpp +++ b/src/corelib/tools/qlist.cpp @@ -209,7 +209,7 @@ void **QListData::append(const QListData& l) int n = l.d->end - l.d->begin; if (n) { if (e + n > d->alloc) - realloc(grow(e + l.d->end - l.d->begin)); + realloc(grow(e + n)); ::memcpy(d->array + d->end, l.d->array + l.d->begin, n*sizeof(void*)); d->end += n; } @@ -253,11 +253,11 @@ void **QListData::insert(int i) Q_ASSERT(d->ref == 1); if (i <= 0) return prepend(); - if (i >= d->end - d->begin) + int size = d->end - d->begin; + if (i >= size) return append(); bool leftward = false; - int size = d->end - d->begin; if (d->begin == 0) { if (d->end == d->alloc) { |