Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
removed old R# directives
Browse files Browse the repository at this point in the history
  • Loading branch information
aarondandy committed Dec 6, 2014
1 parent 7e47766 commit 6a8ada6
Show file tree
Hide file tree
Showing 33 changed files with 2 additions and 161 deletions.
10 changes: 0 additions & 10 deletions src/Vertesaur.Core/Core/Line2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public static Line2 Standard(double a, double b, double c) {

Point2 p;
Vector2 v;
// ReSharper disable CompareOfFloatsByEqualityOperator
if (a == 0.0) {
p = b == 0.0
? Point2.Zero
Expand All @@ -92,7 +91,6 @@ public static Line2 Standard(double a, double b, double c) {
: new Vector2(-p.X, (c / b) - p.Y);
}
return new Line2(p, v);
// ReSharper restore CompareOfFloatsByEqualityOperator
}

/// <summary>
Expand Down Expand Up @@ -257,7 +255,6 @@ object ICloneable.Clone() {
[Pure]
public Mbr GetMbr() {
Contract.Ensures(Contract.Result<Mbr>() != null);
// ReSharper disable CompareOfFloatsByEqualityOperator
return (
(Direction.X == 0.0)
? (
Expand All @@ -271,7 +268,6 @@ public Mbr GetMbr() {
: new Mbr(Double.NegativeInfinity, Double.NegativeInfinity, Double.PositiveInfinity, Double.PositiveInfinity)
)
);
// ReSharper restore CompareOfFloatsByEqualityOperator
}

/// <summary>
Expand All @@ -283,13 +279,11 @@ public Mbr GetMbr() {
public double Distance(Point2 point) {
var v0 = point - P;
var m = Direction.GetMagnitudeSquared();
// ReSharper disable CompareOfFloatsByEqualityOperator
if (m != 0.0) {
var aDot = Direction.Dot(v0);
return Math.Sqrt(v0.GetMagnitudeSquared() - ((aDot * aDot) / m));
}
return v0.GetMagnitude();
// ReSharper restore CompareOfFloatsByEqualityOperator
}

/// <summary>
Expand All @@ -301,13 +295,11 @@ public double Distance(Point2 point) {
public double DistanceSquared(Point2 point) {
var v0 = point - P;
var m = Direction.GetMagnitudeSquared();
// ReSharper disable CompareOfFloatsByEqualityOperator
if (m != 0.0) {
var aDot = Direction.Dot(v0);
return v0.GetMagnitudeSquared() - ((aDot * aDot) / m);
}
return v0.GetMagnitudeSquared();
// ReSharper restore CompareOfFloatsByEqualityOperator
}

/// <summary>
Expand All @@ -320,14 +312,12 @@ public bool Intersects(Point2 p) {
// TODO: make sure the line used to test for intersection is consistent, (A,B) n P == (B,A) n P
var v0 = p - P;
var m = Direction.GetMagnitudeSquared();
// ReSharper disable CompareOfFloatsByEqualityOperator
if (m != 0.0) {
var aDot = Direction.Dot(v0);
// NOTE: preserve the /m to be consistent with DistanceSquared
return v0.GetMagnitudeSquared() - ((aDot * aDot) / m) == 0.0;
}
return v0.X == 0.0 && v0.Y == 0.0;
// ReSharper restore CompareOfFloatsByEqualityOperator
}


Expand Down
2 changes: 0 additions & 2 deletions src/Vertesaur.Core/Core/LineString2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,9 @@ public Point2 GetCentroid() {
ySum = ySum + ((this[i].Y + this[nextIndex].Y) * m);
}

// ReSharper disable CompareOfFloatsByEqualityOperator
if (0 != mSum) {
return new Point2(xSum / mSum, ySum / mSum);
}
// ReSharper restore CompareOfFloatsByEqualityOperator
}
return lastIndex == 0 ? this[0] : Point2.Invalid;
}
Expand Down
7 changes: 0 additions & 7 deletions src/Vertesaur.Core/Core/Matrix2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
namespace Vertesaur
{

// ReSharper disable CompareOfFloatsByEqualityOperator

/// <summary>
/// A square matrix with two rows and two columns with an element type of double.
/// </summary>
Expand Down Expand Up @@ -289,9 +287,7 @@ public override bool Equals(object obj) {
/// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
/// </returns>
public override int GetHashCode() {
// ReSharper disable NonReadonlyFieldInGetHashCode
return E00.GetHashCode() ^ E11.GetHashCode() ^ -OrderValue;
// ReSharper restore NonReadonlyFieldInGetHashCode
}

/// <summary>
Expand Down Expand Up @@ -731,7 +727,4 @@ public void DivideColumn(int c, double value) {
}
}
}

// ReSharper restore CompareOfFloatsByEqualityOperator

}
4 changes: 0 additions & 4 deletions src/Vertesaur.Core/Core/Matrix3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
namespace Vertesaur
{

// ReSharper disable CompareOfFloatsByEqualityOperator

/// <summary>
/// A square matrix with three rows and three columns with an element type of double.
/// </summary>
Expand Down Expand Up @@ -366,9 +364,7 @@ public override bool Equals(object obj) {
/// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
/// </returns>
public override int GetHashCode() {
// ReSharper disable NonReadonlyFieldInGetHashCode
return E00.GetHashCode() ^ OrderValue;
// ReSharper restore NonReadonlyFieldInGetHashCode
}

/// <summary>
Expand Down
8 changes: 0 additions & 8 deletions src/Vertesaur.Core/Core/Matrix4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

namespace Vertesaur
{

// ReSharper disable CompareOfFloatsByEqualityOperator

/// <summary>
/// A square matrix with four rows and four columns with an element type of double.
/// </summary>
Expand Down Expand Up @@ -338,9 +335,7 @@ private void CopyFrom(Matrix4 m) {
/// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
/// </returns>
public override int GetHashCode() {
// ReSharper disable NonReadonlyFieldInGetHashCode
return E00.GetHashCode() ^ OrderValue;
// ReSharper restore NonReadonlyFieldInGetHashCode
}

/// <summary>
Expand Down Expand Up @@ -932,7 +927,4 @@ public void DivideColumn(int c, double denominator) {
}

}

// ReSharper restore CompareOfFloatsByEqualityOperator

}
7 changes: 1 addition & 6 deletions src/Vertesaur.Core/Core/Mbr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,10 @@ public bool Equals(Mbr other) {
/// <inheritdoc/>
public bool Equals(IMbr<double> other) {
return !ReferenceEquals(null, other)
// ReSharper disable CompareOfFloatsByEqualityOperator
&& XMin == other.XMin
&& XMax == other.XMax
&& YMin == other.YMin
&& YMax == other.YMax
// ReSharper restore CompareOfFloatsByEqualityOperator
;
&& YMax == other.YMax;
}

/// <inheritdoc/>
Expand Down Expand Up @@ -477,7 +474,6 @@ public bool Overlaps(Mbr other) {
if (null == other)
return false;

// ReSharper disable CompareOfFloatsByEqualityOperator
var yMagnitude = Y.GetMagnitude();
if (0 == X.GetMagnitude()) {
if (0 == yMagnitude)
Expand All @@ -496,7 +492,6 @@ public bool Overlaps(Mbr other) {
}
}
return !Equals(other) && Intersects(other);
// ReSharper restore CompareOfFloatsByEqualityOperator
}

/// <inheritdoc/>
Expand Down
4 changes: 0 additions & 4 deletions src/Vertesaur.Core/Core/MultiLineString2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
namespace Vertesaur
{

// ReSharper disable LoopCanBeConvertedToQuery

/// <summary>
/// A collection of line strings.
/// </summary>
Expand Down Expand Up @@ -186,7 +184,6 @@ public Mbr GetMbr() {
/// </summary>
/// <returns>A centroid.</returns>
public Point2 GetCentroid() {
// ReSharper disable CompareOfFloatsByEqualityOperator
var lastIndex = Count - 1;
if (lastIndex > 0) {
var mSum = 0.0;
Expand All @@ -208,7 +205,6 @@ public Point2 GetCentroid() {
}
Contract.Assume(this[0] != null);
return lastIndex == 0 ? this[0].GetCentroid() : Point2.Invalid;
// ReSharper restore CompareOfFloatsByEqualityOperator
}

/// <summary>
Expand Down
5 changes: 0 additions & 5 deletions src/Vertesaur.Core/Core/Point2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
namespace Vertesaur
{

// ReSharper disable CompareOfFloatsByEqualityOperator

/// <summary>
/// A point in 2D space.
/// </summary>
Expand Down Expand Up @@ -351,7 +349,4 @@ bool ISpatiallyEquatable<Point2>.SpatiallyEqual(Point2 other) {
return Equals(other);
}
}

// ReSharper restore CompareOfFloatsByEqualityOperator

}
3 changes: 0 additions & 3 deletions src/Vertesaur.Core/Core/Point3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
namespace Vertesaur
{

// ReSharper disable CompareOfFloatsByEqualityOperator

/// <summary>
/// A point in 3D space.
/// </summary>
Expand Down Expand Up @@ -439,5 +437,4 @@ bool ISpatiallyEquatable<Point3>.SpatiallyEqual(Point3 other) {
return Equals(other);
}
}

}
14 changes: 0 additions & 14 deletions src/Vertesaur.Core/Core/Polygon2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ public void ForceFillWinding(PointWinding desiredWinding) {
/// </summary>
/// <returns>A centroid.</returns>
public Point2 GetCentroid() {
// ReSharper disable CompareOfFloatsByEqualityOperator
if (Count > 0) {
if (Count == 1) {
Contract.Assume(this[0] != null);
Expand All @@ -163,7 +162,6 @@ public Point2 GetCentroid() {
return new Point2(xSum / aSum, ySum / aSum);
}
return Point2.Invalid;
// ReSharper restore CompareOfFloatsByEqualityOperator
}

/// <summary>
Expand Down Expand Up @@ -192,8 +190,6 @@ public bool Intersects(Point2 p) {
var crossCount = 0;
var hasUnconstrainedHoles = false;
var fillRings = new List<Ring2>();
// ReSharper disable LoopCanBeConvertedToQuery
// ReSharper disable ForCanBeConvertedToForeach
foreach (var ring in this) {
if (ring.Hole.HasValue && ring.Hole.Value)
continue;
Expand Down Expand Up @@ -228,8 +224,6 @@ public bool Intersects(Point2 p) {
hasUnconstrainedHoles = true;
}
return (hasUnconstrainedHoles ? 0 : 1) == (crossCount % 2);
// ReSharper restore ForCanBeConvertedToForeach
// ReSharper restore LoopCanBeConvertedToQuery
}

/// <summary>
Expand Down Expand Up @@ -282,15 +276,11 @@ public double GetMagnitude() {
return Double.NaN;

var sum = 0.0;
// ReSharper disable LoopCanBeConvertedToQuery
// ReSharper disable ForCanBeConvertedToForeach
for (var i = 0; i < Count; i++) {
Contract.Assume(this[i] != null);
sum += this[i].GetMagnitude();
}
return sum;
// ReSharper restore ForCanBeConvertedToForeach
// ReSharper restore LoopCanBeConvertedToQuery
}

/// <inheritdoc/>
Expand All @@ -312,15 +302,11 @@ public double GetArea() {
return Double.NaN;

var sum = 0.0;
// ReSharper disable LoopCanBeConvertedToQuery
// ReSharper disable ForCanBeConvertedToForeach
for (var i = 0; i < Count; i++) {
Contract.Assume(this[i] != null);
sum += this[i].GetArea();
}
return sum;
// ReSharper restore ForCanBeConvertedToForeach
// ReSharper restore LoopCanBeConvertedToQuery
}

/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/Vertesaur.Core/Core/Range.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
namespace Vertesaur
{

// ReSharper disable CompareOfFloatsByEqualityOperator

/// <summary>
/// A range which encompasses all values between two values, inclusive.
/// </summary>
Expand Down
6 changes: 0 additions & 6 deletions src/Vertesaur.Core/Core/Ray2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,10 @@ public override string ToString() {
/// </summary>
/// <returns>The length.</returns>
public double GetMagnitude() {
// ReSharper disable CompareOfFloatsByEqualityOperator
Contract.Ensures(
Contract.Result<double>() == 0.0
|| Double.IsNaN(Contract.Result<double>())
|| Contract.Result<double>() == Double.PositiveInfinity);
// ReSharper restore CompareOfFloatsByEqualityOperator
return Vector2.Zero.Equals(Direction) ? 0 : Double.PositiveInfinity;
}

Expand All @@ -165,12 +163,10 @@ public double GetMagnitude() {
/// </summary>
/// <returns>The length.</returns>
public double GetMagnitudeSquared() {
// ReSharper disable CompareOfFloatsByEqualityOperator
Contract.Ensures(
Contract.Result<double>() == 0.0
|| Double.IsNaN(Contract.Result<double>())
|| Contract.Result<double>() == Double.PositiveInfinity);
// ReSharper restore CompareOfFloatsByEqualityOperator
return GetMagnitude();
}

Expand All @@ -197,7 +193,6 @@ object ICloneable.Clone() {
/// <returns>A minimum bounding rectangle.</returns>
public Mbr GetMbr() {
Contract.Ensures(Contract.Result<Mbr>() != null);
// ReSharper disable CompareOfFloatsByEqualityOperator
return (
(Direction.X == 0.0)
? (
Expand Down Expand Up @@ -231,7 +226,6 @@ public Mbr GetMbr() {
)
)
);
// ReSharper restore CompareOfFloatsByEqualityOperator
}

/// <summary>
Expand Down
4 changes: 0 additions & 4 deletions src/Vertesaur.Core/Core/Ring2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ public double GetArea() {
/// </summary>
/// <returns>The centroid of the ring.</returns>
public Point2 GetCentroid() {
// ReSharper disable CompareOfFloatsByEqualityOperator
var lastIndex = _pointList.Count - 1;
if (lastIndex > 1) {
var sumValue = 0.0;
Expand Down Expand Up @@ -566,7 +565,6 @@ public Point2 GetCentroid() {
: Point2.Invalid
)
);
// ReSharper restore CompareOfFloatsByEqualityOperator
}

/// <summary>
Expand All @@ -579,7 +577,6 @@ public Point2 GetCentroid() {
/// </list></remarks>
/// <returns>The point winding of the ring.</returns>
public PointWinding DetermineWinding() {
// ReSharper disable CompareOfFloatsByEqualityOperator
var areaSum = GetAreaSumValue();
return (
(0 == areaSum || Double.IsNaN(areaSum) || Double.IsInfinity(areaSum))
Expand All @@ -590,7 +587,6 @@ public PointWinding DetermineWinding() {
: PointWinding.CounterClockwise
)
);
// ReSharper restore CompareOfFloatsByEqualityOperator
}

/// <summary>
Expand Down
Loading

0 comments on commit 6a8ada6

Please sign in to comment.