Skip to content

Commit cff5b56

Browse files
committed
Use at() instead of operator [] to avoid detach and save time
1 parent 45ebe53 commit cff5b56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/providers/spatialite/qgsspatialitefeatureiterator.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,13 @@ bool QgsSpatiaLiteFeatureIterator::getFeature( sqlite3_stmt *stmt, QgsFeature &f
321321
if ( ic <= mRequest.subsetOfAttributes().size() )
322322
{
323323
int attrIndex = mRequest.subsetOfAttributes()[ic-1];
324-
feature.setAttribute( attrIndex, getFeatureAttribute( stmt, ic, mSource->mFields[attrIndex].type() ) );
324+
feature.setAttribute( attrIndex, getFeatureAttribute( stmt, ic, mSource->mFields.at( attrIndex ).type() ) );
325325
}
326326
}
327327
else
328328
{
329329
int attrIndex = ic - 1;
330-
feature.setAttribute( attrIndex, getFeatureAttribute( stmt, ic, mSource->mFields[attrIndex].type() ) );
330+
feature.setAttribute( attrIndex, getFeatureAttribute( stmt, ic, mSource->mFields.at( attrIndex ).type() ) );
331331
}
332332
}
333333
}

0 commit comments

Comments
 (0)