Bug 1298606: P3. Fix coding style. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 29 Aug 2016 16:59:17 +1000
changeset 407033 7e473a486ce60a27fa806b2c5d2cb5324db886ce
parent 407032 5a028fa1fda0c01a76031e11be1da696c3cab285
child 407034 6fc901d7536105aff6cb37eb514048e8696ff4bd
push id27893
push userbmo:gasolin@mozilla.com
push dateTue, 30 Aug 2016 03:41:38 +0000
reviewersgerald
bugs1298606
milestone51.0a1
Bug 1298606: P3. Fix coding style. r=gerald MozReview-Commit-ID: L5MHnYOkyDV
dom/media/Intervals.h
--- a/dom/media/Intervals.h
+++ b/dom/media/Intervals.h
@@ -40,17 +40,17 @@ class Interval
 {
 public:
   typedef Interval<T> SelfType;
 
   Interval()
     : mStart(T())
     , mEnd(T())
     , mFuzz(T())
-  {}
+  { }
 
   template<typename StartArg, typename EndArg>
   Interval(StartArg&& aStart, EndArg&& aEnd)
     : mStart(Forward<StartArg>(aStart))
     , mEnd(Forward<EndArg>(aEnd))
     , mFuzz()
   {
     MOZ_ASSERT(aStart <= aEnd);
@@ -64,17 +64,17 @@ public:
   {
     MOZ_ASSERT(aStart <= aEnd);
   }
 
   Interval(const SelfType& aOther)
     : mStart(aOther.mStart)
     , mEnd(aOther.mEnd)
     , mFuzz(aOther.mFuzz)
-  {}
+  { }
 
   Interval(SelfType&& aOther)
     : mStart(Move(aOther.mStart))
     , mEnd(Move(aOther.mEnd))
     , mFuzz(Move(aOther.mFuzz))
   { }
 
   SelfType& operator= (const SelfType& aOther)
@@ -131,47 +131,47 @@ public:
 
   bool ContainsWithStrictEnd(const T& aX) const
   {
     return mStart - mFuzz <= aX && aX < mEnd;
   }
 
   bool Contains(const SelfType& aOther) const
   {
-    return (mStart - mFuzz <= aOther.mStart + aOther.mFuzz) &&
-      (aOther.mEnd - aOther.mFuzz <= mEnd + mFuzz);
+    return (mStart - mFuzz <= aOther.mStart + aOther.mFuzz)
+           && (aOther.mEnd - aOther.mFuzz <= mEnd + mFuzz);
   }
 
   bool ContainsStrict(const SelfType& aOther) const
   {
     return mStart <= aOther.mStart && aOther.mEnd <= mEnd;
   }
 
   bool ContainsWithStrictEnd(const SelfType& aOther) const
   {
-    return (mStart - mFuzz <= aOther.mStart + aOther.mFuzz) &&
-      aOther.mEnd <= mEnd;
+    return (mStart - mFuzz <= aOther.mStart + aOther.mFuzz)
+           && aOther.mEnd <= mEnd;
   }
 
   bool Intersects(const SelfType& aOther) const
   {
-    return (mStart - mFuzz < aOther.mEnd + aOther.mFuzz) &&
-      (aOther.mStart - aOther.mFuzz < mEnd + mFuzz);
+    return (mStart - mFuzz < aOther.mEnd + aOther.mFuzz)
+           && (aOther.mStart - aOther.mFuzz < mEnd + mFuzz);
   }
 
   bool IntersectsStrict(const SelfType& aOther) const
   {
     return mStart < aOther.mEnd && aOther.mStart < mEnd;
   }
 
   // Same as Intersects, but including the boundaries.
   bool Touches(const SelfType& aOther) const
   {
-    return (mStart - mFuzz <= aOther.mEnd + aOther.mFuzz) &&
-      (aOther.mStart - aOther.mFuzz <= mEnd + mFuzz);
+    return (mStart - mFuzz <= aOther.mEnd + aOther.mFuzz)
+           && (aOther.mStart - aOther.mFuzz <= mEnd + mFuzz);
   }
 
   // Returns true if aOther is strictly to the right of this and contiguous.
   // This operation isn't commutative.
   bool Contiguous(const SelfType& aOther) const
   {
     return mEnd <= aOther.mStart && aOther.mStart - mEnd <= mFuzz + aOther.mFuzz;
   }
@@ -230,19 +230,19 @@ public:
   {
     mFuzz = aFuzz;
   }
 
   // Returns true if the two intervals intersect with this being on the right
   // of aOther
   bool TouchesOnRight(const SelfType& aOther) const
   {
-    return aOther.mStart <= mStart  &&
-      (mStart - mFuzz <= aOther.mEnd + aOther.mFuzz) &&
-      (aOther.mStart - aOther.mFuzz <= mEnd + mFuzz);
+    return aOther.mStart <= mStart
+           && (mStart - mFuzz <= aOther.mEnd + aOther.mFuzz)
+           && (aOther.mStart - aOther.mFuzz <= mEnd + mFuzz);
   }
 
   T mStart;
   T mEnd;
   T mFuzz;
 
 private:
 };
@@ -567,53 +567,59 @@ public:
 
     if (aExists) {
       return mIntervals[aIndex].mEnd;
     } else {
       return T();
     }
   }
 
-  bool Contains(const ElemType& aInterval) const {
+  bool Contains(const ElemType& aInterval) const
+  {
     for (const auto& interval : mIntervals) {
       if (interval.Contains(aInterval)) {
         return true;
       }
     }
     return false;
   }
 
-  bool ContainsStrict(const ElemType& aInterval) const {
+  bool ContainsStrict(const ElemType& aInterval) const
+  {
     for (const auto& interval : mIntervals) {
       if (interval.ContainsStrict(aInterval)) {
         return true;
       }
     }
     return false;
   }
 
-  bool Contains(const T& aX) const {
-    for (const auto& interval : mIntervals) {
+  bool Contains(const T& aX) const
+  {
+    for (const auto& interval : mIntervals)
+    {
       if (interval.Contains(aX)) {
         return true;
       }
     }
     return false;
   }
 
-  bool ContainsStrict(const T& aX) const {
+  bool ContainsStrict(const T& aX) const
+  {
     for (const auto& interval : mIntervals) {
       if (interval.ContainsStrict(aX)) {
         return true;
       }
     }
     return false;
   }
 
-  bool ContainsWithStrictEnd(const T& aX) const {
+  bool ContainsWithStrictEnd(const T& aX) const
+  {
     for (const auto& interval : mIntervals) {
       if (interval.ContainsWithStrictEnd(aX)) {
         return true;
       }
     }
     return false;
   }
 
@@ -622,17 +628,18 @@ public:
   {
     for (auto& interval : mIntervals) {
       interval.mStart = interval.mStart + aOffset;
       interval.mEnd = interval.mEnd + aOffset;
     }
     return *this;
   }
 
-  void SetFuzz(const T& aFuzz) {
+  void SetFuzz(const T& aFuzz)
+  {
     for (auto& interval : mIntervals) {
       interval.SetFuzz(aFuzz);
     }
     Normalize();
   }
 
   static const IndexType NoIndex = IndexType(-1);