diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-03-11 23:06:37 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2013-11-15 17:38:44 +0100 |
commit | f2c6973ed74702e7a7434cdc2630be3d8ba87b59 (patch) | |
tree | 436c8d29dafe2f2ead4b72284d591c1b52dec2a2 /Algorithms/Part-I/3-Collinear/Point.java | |
parent | ec3365b10f7cc8d07926ba8377212f1793e26ba7 (diff) | |
download | coursera-f2c6973ed74702e7a7434cdc2630be3d8ba87b59.zip coursera-f2c6973ed74702e7a7434cdc2630be3d8ba87b59.tar.gz |
Algorithms-I : 3-Collinear: speed and sub segments fixed
Diffstat (limited to 'Algorithms/Part-I/3-Collinear/Point.java')
-rw-r--r-- | Algorithms/Part-I/3-Collinear/Point.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Algorithms/Part-I/3-Collinear/Point.java b/Algorithms/Part-I/3-Collinear/Point.java index bd5bbe7..1dddb53 100644 --- a/Algorithms/Part-I/3-Collinear/Point.java +++ b/Algorithms/Part-I/3-Collinear/Point.java @@ -67,6 +67,7 @@ public class Point implements Comparable<Point> { // is this point lexicographically smaller than that one? // comparing y-coordinates and breaking ties by x-coordinates public int compareTo(Point that) { + if (this == that) return 0; if (this.y < that.y) return -1; if (this.y > that.y) return 1; if (this.x < that.x) return -1; |