Selaa lähdekoodia

#18051: Remove unnecessary variable assignments

Xavier Cho 7 vuotta sitten
vanhempi
commit
93dd59d763

+ 0 - 4
modules/mono/glue/cs_files/AABB.cs

@@ -123,7 +123,6 @@ namespace Godot
             if (size.z > max_size)
             {
                 axis = new Vector3(0f, 0f, 1f);
-                max_size = size.z;
             }
 
             return axis;
@@ -143,7 +142,6 @@ namespace Godot
             if (size.z > max_size)
             {
                 axis = Vector3.Axis.Z;
-                max_size = size.z;
             }
 
             return axis;
@@ -176,7 +174,6 @@ namespace Godot
             if (size.z < max_size)
             {
                 axis = new Vector3(0f, 0f, 1f);
-                max_size = size.z;
             }
 
             return axis;
@@ -196,7 +193,6 @@ namespace Godot
             if (size.z < max_size)
             {
                 axis = Vector3.Axis.Z;
-                max_size = size.z;
             }
 
             return axis;

+ 3 - 3
modules/mono/glue/cs_files/Color.cs

@@ -342,7 +342,7 @@ namespace Godot
             for (var i = 0; i < 2; i++)
             {
                 int c = str[i + ofs];
-                var v = 0;
+                int v;
 
                 if (c >= '0' && c <= '9')
                 {
@@ -403,7 +403,7 @@ namespace Godot
             if (color[0] == '#')
                 color = color.Substring(1, color.Length - 1);
 
-            var alpha = false;
+            bool alpha;
 
             if (color.Length == 8)
                 alpha = true;
@@ -449,7 +449,7 @@ namespace Godot
             if (rgba[0] == '#')
                 rgba = rgba.Substring(1);
 
-            var alpha = false;
+            bool alpha;
 
             if (rgba.Length == 8)
             {

+ 1 - 1
modules/mono/glue/cs_files/GD.cs

@@ -124,7 +124,7 @@ namespace Godot
                 return new int[0];
 
             // Calculate count
-            var count = 0;
+            int count;
 
             if (increment > 0)
                 count = ((to - from - 1) / increment) + 1;

+ 2 - 2
modules/mono/glue/cs_files/StringExtensions.cs

@@ -259,7 +259,7 @@ namespace Godot
         {
             int basepos = instance.Find("://");
 
-            var rs = string.Empty;
+            string rs;
             var @base = string.Empty;
 
             if (basepos != -1)
@@ -378,7 +378,7 @@ namespace Godot
 
             while (instance[src] != 0 && text[tgt] != 0)
             {
-                var match = false;
+                bool match;
 
                 if (case_insensitive)
                 {

+ 1 - 1
modules/mono/glue/cs_files/Transform2D.cs

@@ -165,7 +165,7 @@ namespace Godot
             // Clamp dot to [-1, 1]
             dot = (dot < -1.0f) ? -1.0f : ((dot > 1.0f) ? 1.0f : dot);
 
-            var v = new Vector2();
+            Vector2 v;
 
             if (dot > 0.9995f)
             {