diff --git a/src/Computer.V2.Lib/DummyClass.cs b/src/Computer.V2.Lib/DummyClass.cs new file mode 100644 index 0000000..21a645d --- /dev/null +++ b/src/Computer.V2.Lib/DummyClass.cs @@ -0,0 +1,14 @@ +namespace Computer.V2.Lib; + +public class DummyClass { + private const int SOME_NUMBER = 1; + private const int SOME_OTHER_NUMBER = 2; + public bool ShouldDoSomething(int someNumber) + { + var someString = string.Empty; + if (someNumber == SOME_NUMBER) someString = "1"; + if (someNumber == SOME_OTHER_NUMBER) someString = "2"; + + return someString == "1"; + } +} \ No newline at end of file diff --git a/src/Computer.V2.Lib/Functions.cs b/src/Computer.V2.Lib/Functions.cs index 21d71b3..e89a58e 100644 --- a/src/Computer.V2.Lib/Functions.cs +++ b/src/Computer.V2.Lib/Functions.cs @@ -35,10 +35,10 @@ public static string NormaliseFunc(string expression) } } expression = Maths.Calculate(expression); - expression = newExpression != "" ? $"{newExpression}{(expression != ""? (expression[0] != '+' && expression[0] != '-'? "+": "") :"")}{expression}" : expression; + expression = newExpression != String.Empty ? $"{newExpression}{(expression != ""? (expression[0] != '+' && expression[0] != '-'? "+": "") :"")}{expression}" : expression; if (braceMatches.Count <= 0) return (expression); { - var expr = ""; + var expr = string.Empty; for (var i = braceMatches.Count - 1; i >= 0; i--) { expr += braceMatches[i].Value;