Skip to content

Commit

Permalink
Spring cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Emik03 committed Jul 16, 2021
1 parent ab0a96f commit 21f5111
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
20 changes: 20 additions & 0 deletions Source/Helpers/EventHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,10 @@ public static Action Combine(this Action self, params Action[] others)
return self;

foreach (var other in others)
{
if (other is { })
self += other;
}

return self;
}
Expand All @@ -208,8 +210,10 @@ public static Action<T> Combine<T>(this Action<T> self, params Action<T>[] other
return self;

foreach (var other in others)
{
if (other is { })
self += other;
}

return self;
}
Expand All @@ -226,8 +230,10 @@ public static Action<T1, T2> Combine<T1, T2>(this Action<T1, T2> self, params Ac
return self;

foreach (var other in others)
{
if (other is { })
self += other;
}

return self;
}
Expand All @@ -244,8 +250,10 @@ public static Action<T1, T2, T3> Combine<T1, T2, T3>(this Action<T1, T2, T3> sel
return self;

foreach (var other in others)
{
if (other is { })
self += other;
}

return self;
}
Expand All @@ -262,8 +270,10 @@ public static Action<T1, T2, T3, T4> Combine<T1, T2, T3, T4>(this Action<T1, T2,
return self;

foreach (var other in others)
{
if (other is { })
self += other;
}

return self;
}
Expand Down Expand Up @@ -317,8 +327,10 @@ public static Func<TResult> Combine<TResult>(this Func<TResult> self, params Fun
return self;

foreach (var other in others)
{
if (other is { })
self += other;
}

return self;
}
Expand All @@ -335,8 +347,10 @@ public static Func<T, TResult> Combine<T, TResult>(this Func<T, TResult> self, p
return self;

foreach (var other in others)
{
if (other is { })
self += other;
}

return self;
}
Expand All @@ -353,8 +367,10 @@ public static Func<T1, T2, TResult> Combine<T1, T2, TResult>(this Func<T1, T2, T
return self;

foreach (var other in others)
{
if (other is { })
self += other;
}

return self;
}
Expand All @@ -371,8 +387,10 @@ public static Func<T1, T2, T3, TResult> Combine<T1, T2, T3, TResult>(this Func<T
return self;

foreach (var other in others)
{
if (other is { })
self += other;
}

return self;
}
Expand All @@ -389,8 +407,10 @@ public static Func<T1, T2, T3, T4, TResult> Combine<T1, T2, T3, T4, TResult>(thi
return self;

foreach (var other in others)
{
if (other is { })
self += other;
}

return self;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/MonoBehaviours/ModuleScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ private static IEnumerator CheckForUpdates()

_hasCheckedVersion = true;

WWW www = new WWW("https://api.github.com/repos/Emik03/KeepCoding/releases/latest");
var www = new WWW("https://api.github.com/repos/Emik03/KeepCoding/releases/latest");
yield return www;

if (www.error is { })
Expand Down
6 changes: 3 additions & 3 deletions Source/MonoBehaviours/ReflectionScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private static NullableObject GetDeepValue(in object instance, in string[] names
{
var current = new NullableObject(instance);

foreach (var name in names)
foreach (string name in names)
{
if (current is null)
return null;
Expand Down Expand Up @@ -158,7 +158,7 @@ private static NullableObject GetDeepValue(in object instance, in string[] names

private static NullableObject GetField(in Type type, in string name, in object instance)
{
FieldInfo field = type?.GetField(name);
var field = type?.GetField(name);

return field is null ? null
: new NullableObject(field.IsStatic ? field.GetValue(null)
Expand All @@ -167,7 +167,7 @@ private static NullableObject GetField(in Type type, in string name, in object i

private static NullableObject GetProperty(in Type type, in string name, in object instance)
{
PropertyInfo property = type?.GetProperty(name);
var property = type?.GetProperty(name);

return property is null ? null
: new NullableObject(property.GetAccessors(false).Any(x => x.IsStatic) ? property.GetValue(null, null)
Expand Down

0 comments on commit 21f5111

Please sign in to comment.