Skip to content

Commit 7fcf3c0

Browse files
committed
check pointers for fast matching
1 parent 87a40d8 commit 7fcf3c0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/eu/mihosoft/vrl/v3d/Vector3d.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,12 @@ public String toString() {
430430
*/
431431
@Override
432432
public boolean equals(Object obj) {
433+
if(this==obj)
434+
return true;
433435
if (!Vector3d.class.isInstance(obj)) {
434436
return false;
435437
}
436-
return test((Vector3d)obj,Plane.EPSILON_Point);
438+
return test((Vector3d)obj,Plane.getEPSILON());
437439
}
438440

439441
double distance(Vector3d v) {
@@ -442,6 +444,8 @@ public boolean equals(Object obj) {
442444
}
443445

444446
public boolean test(Vector3d obj, double epsilon) {
447+
if(this==obj)
448+
return true;
445449
if (obj == null) {
446450
return false;
447451
}

0 commit comments

Comments
 (0)