diff options
author | Sven Gothel <[email protected]> | 2010-11-06 06:17:41 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-11-06 06:17:41 +0100 |
commit | 8df147c4a1d7e2e5d63416a1bee979be858440d0 (patch) | |
tree | 32709ce1ce9c6c00ed806e61e36ad896b1862dd2 /src/nativewindow | |
parent | 1be7b5271ec1d08b6929a88dd811754d33d149de (diff) |
Added fast path to equals impl.
Diffstat (limited to 'src/nativewindow')
6 files changed, 6 insertions, 0 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java index 9df57b6d2..6c875ab40 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java +++ b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java @@ -74,6 +74,7 @@ public class Capabilities implements Cloneable { } public boolean equals(Object obj) { + if(this == obj) { return true; } if(!(obj instanceof Capabilities)) { return false; } diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java index 86e1b8d28..a970be158 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java +++ b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java @@ -78,6 +78,7 @@ public class Dimension implements Cloneable, DimensionReadOnly { } public boolean equals(Object obj) { + if(this == obj) { return true; } if (obj instanceof Dimension) { Dimension p = (Dimension)obj; return height == p.height && diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java b/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java index c7fa247bf..96a45b7b1 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java +++ b/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java @@ -70,6 +70,7 @@ public class Insets implements Cloneable { * otherwise <code>false</code>. */ public boolean equals(Object obj) { + if(this == obj) { return true; } if (obj instanceof Insets) { Insets insets = (Insets)obj; return ((top == insets.top) && (left == insets.left) && diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java index 76f1d69c5..6db0ecfe2 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java +++ b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java @@ -51,6 +51,7 @@ public class Point implements Cloneable, PointReadOnly { } public boolean equals(Object obj) { + if(this == obj) { return true; } if (obj instanceof Point) { Point p = (Point)obj; return y == p.y && x == p.x; diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java index f4808929b..ba24bc64e 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java +++ b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java @@ -63,6 +63,7 @@ public class Rectangle implements Cloneable, RectangleReadOnly { public void setHeight(int height) { this.height = height; } public boolean equals(Object obj) { + if(this == obj) { return true; } if (obj instanceof Rectangle) { Rectangle rect = (Rectangle)obj; return (y == rect.y) && (x == rect.x) && diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java index 294fa2d13..ea098b967 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java +++ b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java @@ -76,6 +76,7 @@ public class SurfaceSize implements Cloneable { * otherwise <code>false</code>. */ public final boolean equals(Object obj) { + if(this == obj) { return true; } if (obj instanceof SurfaceSize) { SurfaceSize p = (SurfaceSize)obj; return getResolution().equals(p.getResolution()) && |