From fab28fbc4728ed08a60f58c84460e105497dbe83 Mon Sep 17 00:00:00 2001 From: pointfeev Date: Sat, 20 Apr 2024 19:51:24 -0400 Subject: [PATCH] refactor --- CreamInstaller/Forms/UpdateForm.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CreamInstaller/Forms/UpdateForm.cs b/CreamInstaller/Forms/UpdateForm.cs index 3840337..481d0cc 100644 --- a/CreamInstaller/Forms/UpdateForm.cs +++ b/CreamInstaller/Forms/UpdateForm.cs @@ -79,9 +79,8 @@ internal sealed partial class UpdateForm : CustomForm updateButton.Enabled = true; updateButton.Click += OnUpdate; changelogTreeView.Visible = true; - for (int r = 0; r < releases!.Count; r++) + foreach (ProgramRelease release in releases) { - ProgramRelease release = releases[r]; #if !DEBUG if (release.Version <= currentVersion) continue; @@ -90,10 +89,9 @@ internal sealed partial class UpdateForm : CustomForm changelogTreeView.Nodes.Add(root); if (changelogTreeView.Nodes.Count > 0) changelogTreeView.Nodes[0].EnsureVisible(); - for (int c = 0; c < release.Changes.Length; c++) + foreach (string change in release.Changes) Invoke(delegate { - string change = release.Changes[c]; TreeNode changeNode = new() { Text = change }; root.Nodes.Add(changeNode); root.Expand();