TheKedge
22nd January 2007, 10:14
Hello all,
just a quick question - apparently QVarLengthArray is faster assigining memory. But is
QVector<> (with any assignable basic type) slower in a loop e.g. using ...
QVector<short> vector (1024);
for(int i=0; i<vector.size();++i){
someShort = vector.at(i);
or
vector[i] = i;
}
or should I make a short* from vector.data() and put the pointer into the loop?
By the way, does the vector.size() get calculated every iteration?
thanks
K
just a quick question - apparently QVarLengthArray is faster assigining memory. But is
QVector<> (with any assignable basic type) slower in a loop e.g. using ...
QVector<short> vector (1024);
for(int i=0; i<vector.size();++i){
someShort = vector.at(i);
or
vector[i] = i;
}
or should I make a short* from vector.data() and put the pointer into the loop?
By the way, does the vector.size() get calculated every iteration?
thanks
K