From fe80d93bdfd30fbe8eb1bbe78f2182a0fa79d901 Mon Sep 17 00:00:00 2001 From: Mattrixwv Date: Mon, 24 Aug 2020 14:18:45 -0400 Subject: [PATCH] Updated to fix some warnings --- CSClasses/Algorithms.cs | 9 +++++++++ CSClasses/Stopwatch.cs | 8 ++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CSClasses/Algorithms.cs b/CSClasses/Algorithms.cs index 4a50d57..c7f42ad 100644 --- a/CSClasses/Algorithms.cs +++ b/CSClasses/Algorithms.cs @@ -124,6 +124,9 @@ namespace mee{ } //TODO: If for some reason the goalNumber is not 1 throw an error + if(goalNumber != 1){ + + } //Return the list of factors return factors; @@ -155,6 +158,9 @@ namespace mee{ } //TODO: If for some reason the goalNumber is not 1 throw an error + if(goalNumber != 1){ + + } //Return the list of factors return factors; @@ -186,6 +192,9 @@ namespace mee{ } //TODO: If for some reason the goalNumber is not 1 throw an error + if(goalNumber != 1){ + + } //Return the list of factors return factors; diff --git a/CSClasses/Stopwatch.cs b/CSClasses/Stopwatch.cs index 1da6341..e3a09c0 100644 --- a/CSClasses/Stopwatch.cs +++ b/CSClasses/Stopwatch.cs @@ -22,7 +22,7 @@ Copyright (C) 2020 Matthew Ellison namespace mee{ public class Stopwatch{ //Variables - private System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); //The stopwatch that is used + private readonly System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); //The stopwatch that is used private enum TIME_RESOLUTION{ NANOSECOND, MICROSECOND, MILLISECOND, SECOND, MINUTE, HOUR, ERROR }; private const int NUM_TO_RUN = 100000; private readonly long nanosecPerTick = 1000000000L / System.Diagnostics.Stopwatch.Frequency; @@ -30,10 +30,6 @@ namespace mee{ //Constructor makes sure all values are set to defaults public Stopwatch(){ } - //Returns a long with the elapsed time in nanoseconds. Used by other functions to get the time before converting it to the correct resolution - private long GetTime(){ - return stopwatch.ElapsedTicks; - } //Simultates starting a stopwatch public void Start(){ stopwatch.Start(); @@ -121,7 +117,7 @@ namespace mee{ } //Tests - public static void Main(string[] args){ + public static void Main(){ System.Console.WriteLine("Testing start/stop"); TestStartStop(); System.Console.WriteLine("start/stop completed successfully");