forked from mirrors/gecko-dev
Bug 556303: Fix unsigned/signed compiler warning in nsTArray.cpp. r=bsmedberg
This commit is contained in:
parent
2c202e279b
commit
874a758d9b
1 changed files with 3 additions and 1 deletions
|
|
@ -85,7 +85,9 @@ nsTArray_base::EnsureCapacity(size_type capacity, size_type elemSize) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use doubling algorithm when forced to increase available capacity.
|
// Use doubling algorithm when forced to increase available capacity.
|
||||||
capacity = PR_MAX(capacity, mHdr->mCapacity << 1);
|
// (Note that mCapacity is only 31 bits wide, so multiplication promotes its
|
||||||
|
// type. We use |2u| instead of |2| to make sure it's promoted to unsigned.)
|
||||||
|
capacity = PR_MAX(capacity, mHdr->mCapacity * 2u);
|
||||||
|
|
||||||
Header *header;
|
Header *header;
|
||||||
if (UsesAutoArrayBuffer()) {
|
if (UsesAutoArrayBuffer()) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue