We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cb3884 commit ffddca8Copy full SHA for ffddca8
llvm/include/llvm/ADT/SmallVector.h
@@ -100,8 +100,9 @@ template <class Size_T> class SmallVectorBase {
100
///
101
/// This does not construct or destroy any elements in the vector.
102
void set_size(size_t N) {
103
- assert(N <= capacity()); // implies no overflow in assignment
104
- Size = static_cast<Size_T>(N);
+ auto n = static_cast<Size_T>(N);
+ assert(n <= capacity());
105
+ Size = n;
106
}
107
108
/// Set the array data pointer to \p Begin and capacity to \p N.
0 commit comments