diff options
Diffstat (limited to 'src/corelib/tools/qvarlengtharray.h')
-rw-r--r-- | src/corelib/tools/qvarlengtharray.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 34a64dafe2..309d2a2dca 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -318,7 +318,7 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a template <class T, int Prealloc> Q_OUTOFLINE_TEMPLATE T QVarLengthArray<T, Prealloc>::value(int i) const { - if (i < 0 || i >= size()) { + if (uint(i) >= uint(size())) { return T(); } return at(i); @@ -326,7 +326,7 @@ Q_OUTOFLINE_TEMPLATE T QVarLengthArray<T, Prealloc>::value(int i) const template <class T, int Prealloc> Q_OUTOFLINE_TEMPLATE T QVarLengthArray<T, Prealloc>::value(int i, const T &defaultValue) const { - return (i < 0 || i >= size()) ? defaultValue : at(i); + return (uint(i) >= uint(size())) ? defaultValue : at(i); } template <class T, int Prealloc> |