Bug 845429: Cast a known-nonnegative index to be unsigned for comparison vs. nsTArray::Length(), in nsDocShell::GetChildAt. r=tbsaunde

This commit is contained in:
Daniel Holbert 2013-02-26 14:09:55 -08:00
parent a96f6b66a2
commit eaf8119ef5

View File

@ -3597,8 +3597,7 @@ nsDocShell::GetChildAt(int32_t aIndex, nsIDocShellTreeItem ** aChild)
#ifdef DEBUG
if (aIndex < 0) {
NS_WARNING("Negative index passed to GetChildAt");
}
else if (aIndex >= mChildList.Length()) {
} else if (static_cast<uint32_t>(aIndex) >= mChildList.Length()) {
NS_WARNING("Too large an index passed to GetChildAt");
}
#endif