diff --git a/src/Microsoft.ML.Core/Utilities/ThreadUtils.cs b/src/Microsoft.ML.Core/Utilities/ThreadUtils.cs index 9e08475d40..722791737e 100644 --- a/src/Microsoft.ML.Core/Utilities/ThreadUtils.cs +++ b/src/Microsoft.ML.Core/Utilities/ThreadUtils.cs @@ -66,7 +66,7 @@ private static Task Queue(Delegate threadStart, object state) // Return the task. return tcs.Task; - void CreateThread() + static void CreateThread() { // Create a new background thread to run the work. var t = new Thread(() => @@ -96,7 +96,7 @@ void CreateThread() t.Start(); } - void Enqueue((Delegate, object, TaskCompletionSource) item) + static void Enqueue((Delegate, object, TaskCompletionSource) item) { // Enqueue the work. If there are currently fewer threads waiting // for work than there are work items in the queue, create another @@ -120,7 +120,7 @@ void Enqueue((Delegate, object, TaskCompletionSource) item) CreateThread(); } - bool TryDequeue(out (Delegate action, object state, TaskCompletionSource tcs) item) + static bool TryDequeue(out (Delegate action, object state, TaskCompletionSource tcs) item) { // Dequeues the next item if one is available. Before checking, // the available thread count is increased, so that enqueuers can diff --git a/src/Microsoft.ML.Data/DataLoadSave/LegacyCompositeDataLoader.cs b/src/Microsoft.ML.Data/DataLoadSave/LegacyCompositeDataLoader.cs index c293b87c68..82ff23aa2f 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/LegacyCompositeDataLoader.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/LegacyCompositeDataLoader.cs @@ -130,7 +130,7 @@ private static ILegacyDataLoader CreateCore(IHost host, ILegacyDataLoader srcLoa if (Utils.Size(transformArgs) == 0) return srcLoader; - string GetTagData(IComponentFactory factory) + static string GetTagData(IComponentFactory factory) { // When coming from the command line, preserve the string arguments. // For other factories, we aren't able to get the string. diff --git a/test/Microsoft.ML.Functional.Tests/DataTransformation.cs b/test/Microsoft.ML.Functional.Tests/DataTransformation.cs index 6407c5e3f6..0c91c3d7d7 100644 --- a/test/Microsoft.ML.Functional.Tests/DataTransformation.cs +++ b/test/Microsoft.ML.Functional.Tests/DataTransformation.cs @@ -39,7 +39,7 @@ void ExtensibilityAddAColumnAsAFunctionOfMultipleColumns() data = mlContext.Data.TakeRows(data, numSamples); // Create a stand-alone function to produce a random number. - float angiospermCosine(float petalWidth, float petalLength, float sepalWidth, float sepalLength) + static float angiospermCosine(float petalWidth, float petalLength, float sepalWidth, float sepalLength) { var petalMagnitude = Math.Sqrt(petalWidth * petalWidth + petalLength * petalLength); var sepalMagnitude = Math.Sqrt(sepalWidth * sepalWidth + sepalLength * sepalLength); diff --git a/test/Microsoft.ML.Functional.Tests/ModelFiles.cs b/test/Microsoft.ML.Functional.Tests/ModelFiles.cs index 41a5003b5f..081593827c 100644 --- a/test/Microsoft.ML.Functional.Tests/ModelFiles.cs +++ b/test/Microsoft.ML.Functional.Tests/ModelFiles.cs @@ -190,7 +190,7 @@ public void LoadModelAndExtractPredictor() loadedTransformerModel1 = mlContext.Model.LoadWithDataLoader(fs, out var l); } - void AssertIsGam(ITransformer trans) + static void AssertIsGam(ITransformer trans) { Assert.IsType( Assert.IsAssignableFrom( diff --git a/test/Microsoft.ML.Tests/Transformers/ConcatTests.cs b/test/Microsoft.ML.Tests/Transformers/ConcatTests.cs index ee652d1597..9bb5596c66 100644 --- a/test/Microsoft.ML.Tests/Transformers/ConcatTests.cs +++ b/test/Microsoft.ML.Tests/Transformers/ConcatTests.cs @@ -56,7 +56,7 @@ void TestConcat() }, new MultiFileSource(dataPath)); var data = loader.Load(source); - DataViewType GetType(DataViewSchema schema, string name) + static DataViewType GetType(DataViewSchema schema, string name) { Assert.True(schema.TryGetColumnIndex(name, out int cIdx), $"Could not find '{name}'"); return schema[cIdx].Type; @@ -113,7 +113,7 @@ public void ConcatWithAliases() }, new MultiFileSource(dataPath)); var data = loader.Load(source); - DataViewType GetType(DataViewSchema schema, string name) + static DataViewType GetType(DataViewSchema schema, string name) { Assert.True(schema.TryGetColumnIndex(name, out int cIdx), $"Could not find '{name}'"); return schema[cIdx].Type;