Bug 474369 - get rid of nsVoidArray, content followup; r+sr=sicking
authorArpad Borsos <arpad.borsos@googlemail.com>
Fri, 20 Mar 2009 11:41:27 +0100
changeset 26416 591d956f2f0a8458b9de0d3b692b62045b779a2c
parent 26415 e1120120b1b796b702fff6f42cb011b3d3c7e2c3
child 26417 e29ec3dc42ee0bca7b06919815b2dc5eded63c5a
push id6056
push userarpad.borsos@googlemail.com
push dateFri, 20 Mar 2009 11:15:03 +0000
treeherdermozilla-central@591d956f2f0a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs474369
milestone1.9.2a1pre
Bug 474369 - get rid of nsVoidArray, content followup; r+sr=sicking
content/base/src/nsTreeWalker.h
--- a/content/base/src/nsTreeWalker.h
+++ b/content/base/src/nsTreeWalker.h
@@ -162,17 +162,17 @@ private:
     /*
      * Sets the child index at the specified level. It doesn't matter if this
      * fails since mPossibleIndexes should only be considered a hint
      * @param aIndexPos   position in mPossibleIndexes to set
      * @param aChildIndex child index at specified position
      */
     void SetChildIndex(PRInt32 aIndexPos, PRInt32 aChildIndex)
     {
-        if (aIndexPos > 0) {
-            mPossibleIndexes.EnsureLengthAtLeast(aIndexPos+1);
+        if (aIndexPos >= 0 &&
+            mPossibleIndexes.EnsureLengthAtLeast(aIndexPos+1)) {
             mPossibleIndexes.ElementAt(aIndexPos) = aChildIndex;
         }
     }
 };
 
 #endif