OSDN Git Service

[changed] added final when usefull
authorchristoph.widulle <christoph.widulle@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Sun, 14 Nov 2010 21:36:57 +0000 (21:36 +0000)
committerchristoph.widulle <christoph.widulle@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Sun, 14 Nov 2010 21:36:57 +0000 (21:36 +0000)
gdx/src/com/badlogic/gdx/math/Vector2.java

index 0010fd5..2162077 100644 (file)
@@ -167,8 +167,8 @@ public final class Vector2 {
         * @return the distance between this and the other vector\r
         */\r
        public float dst (Vector2 v) {\r
-               float x_d = v.x - x;\r
-               float y_d = v.y - y;\r
+               final float x_d = v.x - x;\r
+               final float y_d = v.y - y;\r
                return (float)Math.sqrt(x_d * x_d + y_d * y_d);\r
        }\r
 \r
@@ -178,8 +178,8 @@ public final class Vector2 {
         * @return the distance between this and the other vector\r
         */\r
        public float dst (float x, float y) {\r
-               float x_d = x - this.x;\r
-               float y_d = y - this.y;\r
+               final float x_d = x - this.x;\r
+               final float y_d = y - this.y;\r
                return (float)Math.sqrt(x_d * x_d + y_d * y_d);\r
        }\r
 \r
@@ -188,8 +188,8 @@ public final class Vector2 {
         * @return the squared distance between this and the other vector\r
         */\r
        public float dst2 (Vector2 v) {\r
-               float x_d = v.x - x;\r
-               float y_d = v.y - y;\r
+               final float x_d = v.x - x;\r
+               final float y_d = v.y - y;\r
                return x_d * x_d + y_d * y_d;\r
        }\r
 \r