Skip to content

Commit

Permalink
Remove ToString calls on string objects
Browse files Browse the repository at this point in the history
  • Loading branch information
n00mkrad committed Nov 26, 2024
1 parent 1872e81 commit 67cbff5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CodeLegacy/IO/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public static bool GetBool(string key)

public static bool GetBool(string key, bool defaultVal)
{
WriteIfDoesntExist(key.ToString(), (defaultVal ? true : false).ToString());
WriteIfDoesntExist(key, (defaultVal ? true : false).ToString());
return bool.Parse(Get(key, Type.Bool));
}

Expand All @@ -195,7 +195,7 @@ public static int GetInt(string key)

public static int GetInt(string key, int defaultVal)
{
WriteIfDoesntExist(key.ToString(), defaultVal.ToString());
WriteIfDoesntExist(key, defaultVal.ToString());
return GetInt(key);
}

Expand All @@ -221,7 +221,7 @@ public static float GetFloat(string key)

public static float GetFloat(string key, float defaultVal)
{
WriteIfDoesntExist(key.ToString(), defaultVal.ToStringDot());
WriteIfDoesntExist(key, defaultVal.ToStringDot());
return Get(key, Type.Float).GetFloat();
}

Expand All @@ -239,7 +239,7 @@ public static string GetFloatString(string key)

static void WriteIfDoesntExist (string key, string val)
{
if (CachedValues.ContainsKey(key.ToString()))
if (CachedValues.ContainsKey(key))
return;

Set(key, val);
Expand Down

0 comments on commit 67cbff5

Please sign in to comment.