Bug 1387002 - Replace .size() by .empty() when applicable in layout/tables/ r?kats draft
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 03 Aug 2017 12:06:35 +0200
changeset 621063 804d564655914b678774f872944a01285ecc42da
parent 621062 2fe9ee312e398d9625e1032b3f2f454f60facf68
child 621064 4a3dfec8f6fa5a07c6e8d428768d3848e0bf20e2
push id72240
push userbmo:sledru@mozilla.com
push dateFri, 04 Aug 2017 08:12:30 +0000
reviewerskats
bugs1387002
milestone57.0a1
Bug 1387002 - Replace .size() by .empty() when applicable in layout/tables/ r?kats MozReview-Commit-ID: 2O9BJcQSRIY
layout/tables/nsTableFrame.cpp
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -967,17 +967,17 @@ nsTableFrame::InsertRows(nsTableRowGroup
 #endif
 
   return numColsToAdd;
 }
 
 void
 nsTableFrame::AddDeletedRowIndex(int32_t aDeletedRowStoredIndex)
 {
-  if (mDeletedRowIndexRanges.size() == 0) {
+  if (mDeletedRowIndexRanges.empty()) {
     mDeletedRowIndexRanges.insert(std::pair<int32_t, int32_t>
                                     (aDeletedRowStoredIndex,
                                      aDeletedRowStoredIndex));
     return;
   }
 
   // Find the position of the current deleted row's stored index
   // among the previous deleted row index ranges and merge ranges if
@@ -1039,17 +1039,17 @@ nsTableFrame::AddDeletedRowIndex(int32_t
                                    (aDeletedRowStoredIndex,
                                     aDeletedRowStoredIndex));
   }
 }
 
 int32_t
 nsTableFrame::GetAdjustmentForStoredIndex(int32_t aStoredIndex)
 {
-  if (mDeletedRowIndexRanges.size() == 0)
+  if (mDeletedRowIndexRanges.empty())
     return 0;
 
   int32_t adjustment = 0;
 
   // O(log(mDeletedRowIndexRanges.size()))
   auto endIter = mDeletedRowIndexRanges.upper_bound(aStoredIndex);
   for (auto iter = mDeletedRowIndexRanges.begin(); iter != endIter; ++iter) {
     adjustment += iter->second - iter->first + 1;