Bug 738705: Remove dead helper-class CompareByContentOrderComparator. r=bz
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 23 Mar 2012 11:17:33 -0700
changeset 93495 682c5137c71046d4078a0873f265ef5216ffa446
parent 93494 11b6f37603cee3d98742bf9aead51f9ab92b576c
child 93496 3e18c3a6535a9edd35d41f1a3af2837fb06660b7
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs738705
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 738705: Remove dead helper-class CompareByContentOrderComparator. r=bz
layout/generic/nsFrameList.cpp
--- a/layout/generic/nsFrameList.cpp
+++ b/layout/generic/nsFrameList.cpp
@@ -369,55 +369,16 @@ nsFrameList::GetLength() const
   nsIFrame* frame = mFirstChild;
   while (frame) {
     count++;
     frame = frame->GetNextSibling();
   }
   return count;
 }
 
-static int CompareByContentOrder(const nsIFrame* aF1, const nsIFrame* aF2)
-{
-  if (aF1->GetContent() != aF2->GetContent()) {
-    return nsLayoutUtils::CompareTreePosition(aF1->GetContent(), aF2->GetContent());
-  }
-
-  if (aF1 == aF2) {
-    return 0;
-  }
-
-  const nsIFrame* f;
-  for (f = aF2; f; f = f->GetPrevInFlow()) {
-    if (f == aF1) {
-      // f1 comes before f2 in the flow
-      return -1;
-    }
-  }
-  for (f = aF1; f; f = f->GetPrevInFlow()) {
-    if (f == aF2) {
-      // f1 comes after f2 in the flow
-      return 1;
-    }
-  }
-
-  NS_ASSERTION(false, "Frames for same content but not in relative flow order");
-  return 0;
-}
-
-class CompareByContentOrderComparator
-{
-  public:
-  bool Equals(const nsIFrame* aA, const nsIFrame* aB) const {
-    return aA == aB;
-  }
-  bool LessThan(const nsIFrame* aA, const nsIFrame* aB) const {
-    return CompareByContentOrder(aA, aB) < 0;
-  }
-};
-
 void
 nsFrameList::ApplySetParent(nsIFrame* aParent) const
 {
   NS_ASSERTION(aParent, "null ptr");
 
   for (nsIFrame* f = FirstChild(); f; f = f->GetNextSibling()) {
     f->SetParent(aParent);
   }