diff --git a/GlitchyEditor/src/Assets/AssetHierarchy.bf b/GlitchyEditor/src/Assets/AssetHierarchy.bf index 87c543a..3feb059 100644 --- a/GlitchyEditor/src/Assets/AssetHierarchy.bf +++ b/GlitchyEditor/src/Assets/AssetHierarchy.bf @@ -497,7 +497,7 @@ class AssetHierarchy void AddEntryToTree(String filePath, bool isDirectory, TreeNode parentNode) { // Try to find the node for the specified path in the given parent - TreeNode treeNode = parentNode.Children.Where(scope (node) => node.Value.Path == filePath).FirstOrDefault(); + TreeNode treeNode = parentNode.Children.Where((node) => node.Value.Path == filePath).FirstOrDefault(); // If no node was found -> create one if (treeNode == null) diff --git a/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf b/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf index 5ea9775..d99815e 100644 --- a/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf +++ b/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf @@ -243,7 +243,7 @@ namespace GlitchyEditor.EditWindows for (StringView entryName in assetCreator.Name.Split('/')) { - AssetCreatorTree nextNode = tree.Children.Where(scope (node) => node->Name == entryName).FirstOrDefault(); + AssetCreatorTree nextNode = tree.Children.Where((node) => node->Name == entryName).FirstOrDefault(); // Create new node if we didn't find it nextNode ??= tree.AddChild((entryName, null)); @@ -720,7 +720,7 @@ namespace GlitchyEditor.EditWindows ImGui.TreeNodeFlags flags = .OpenOnArrow | .SpanAvailWidth; - if(tree.Children.Where(scope (node) => node->IsDirectory).Count() == 0) + if(tree.Children.Where((node) => node->IsDirectory).Count() == 0) flags |= .Leaf; if (tree->Path == CurrentDirectory) @@ -1390,7 +1390,7 @@ namespace GlitchyEditor.EditWindows private void CopySelectedFiles(bool cutFiles) { _filesToCopy.ClearAndDeleteItems(); - _selectedFiles.Select(scope (file) => new String(file)).ToList(_filesToCopy); + _selectedFiles.Select((file) => new String(file)).ToList(_filesToCopy); _cutFiles = cutFiles; } diff --git a/GlitchyEngine.Benchmark/src/Benchmark.bf b/GlitchyEngine.Benchmark/src/Benchmark.bf index 8f2fcfc..90f6a24 100644 --- a/GlitchyEngine.Benchmark/src/Benchmark.bf +++ b/GlitchyEngine.Benchmark/src/Benchmark.bf @@ -55,10 +55,20 @@ class StdDevResultColumn : IResultColumn { TimeSpan meanTime = runToCalculate.ResultColumnValue[MeanTimeResultColumn.ColumnName]; - int64 variance = runToCalculate.RunDurations.Select(scope (d) => { + // For some reason we need to specify the type arguments here. + /*int64 variance = runToCalculate.RunDurations.Sum(scope [=meanTime, =runToCalculate] (d) => { TimeSpan delta = d - meanTime; return (delta * delta).Ticks / runToCalculate.RunCount; - }).Sum(); + });*/ + + int64 variance = 0; + + for (let duration in runToCalculate.RunDurations) + { + TimeSpan delta = duration - meanTime; + variance += (delta * delta).Ticks / runToCalculate.RunCount; + } + return TimeSpan((int64)Math.Sqrt((double)variance)); } } @@ -204,7 +214,7 @@ class BenchmarkResult defer delete columnsToSort; columnsToSort.Sort(scope (a, b) => a.Depth <=> b.Depth); - outColumnCalculationPlan.AddRange(columnsToSort.Select(scope (a) => a.Column)); + outColumnCalculationPlan.AddRange(columnsToSort.Select((a) => a.Column)); } private void CalculateStats(Span customColumns) diff --git a/GlitchyEngine.Test/src/Base/ScriptEngineTestBase.bf b/GlitchyEngine.Test/src/Base/ScriptEngineTestBase.bf index 74a2c0f..c2e7be1 100644 --- a/GlitchyEngine.Test/src/Base/ScriptEngineTestBase.bf +++ b/GlitchyEngine.Test/src/Base/ScriptEngineTestBase.bf @@ -129,7 +129,7 @@ class ScriptEngineTestBase TimeSpan totalRunTime = _runDurations.Sum(); TimeSpan meanRunTime = TimeSpan(totalRunTime.Ticks / runs); - double varianceMs = _runDurations.Select(scope (d) => Math.Pow((d - meanRunTime).TotalMilliseconds, 2)).Sum() / runs; + double varianceMs = _runDurations.Select((d) => Math.Pow((d - meanRunTime).TotalMilliseconds, 2)).Sum() / runs; TimeSpan stdDeviation = TimeSpan.FromMilliseconds(Math.Sqrt(varianceMs)); Console.WriteLine($"Results:");