Bug 738740 - Fix handling of parameters in nsTArray::ReplaceElementAt. r=bz

Handle the parameters given to ReplaceElementAt the same way as those given to
other methods in the class. This allows removal of the & in GLContext.cpp that
was taking the address of a temporary, and causing a build error when using
clang, or when using GCC with particular parameters.
This commit is contained in:
Chris Lord 2012-03-23 19:27:25 +00:00
parent d14fc6c435
commit aa2bb6dae0
2 changed files with 2 additions and 2 deletions

View File

@ -1185,7 +1185,7 @@ void TiledTextureImage::Resize(const nsIntSize& aSize)
nsRefPtr<TextureImage> teximg =
mGL->TileGenFunc(size, mContentType, mUseNearestFilter);
if (replace)
mImages.ReplaceElementAt(i, &teximg.forget());
mImages.ReplaceElementAt(i, teximg.forget());
else
mImages.InsertElementAt(i, teximg.forget());
i++;

View File

@ -754,7 +754,7 @@ public:
// A variation on the ReplaceElementsAt method defined above.
template<class Item>
elem_type *ReplaceElementAt(index_type index, const Item& item) {
return ReplaceElementsAt(index, 1, item, 1);
return ReplaceElementsAt(index, 1, &item, 1);
}
// A variation on the ReplaceElementsAt method defined above.