Skip to content
This repository was archived by the owner on Jul 9, 2024. It is now read-only.

Commit 31ddbf7

Browse files
committed
[Backend] Fixed bisect logic
1 parent f2f4585 commit 31ddbf7

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

DolphinBisectTool/Backend.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void Bisect(string boot_title = "")
4040
int test_index = 0;
4141
RunBuild run_build = new RunBuild();
4242

43-
while (m_first_index <= m_second_index)
43+
while (!(m_first_index == m_second_index-1))
4444
{
4545

4646
test_index = m_first_index == -1 ? (0 + m_second_index) / 2 : (m_first_index + m_second_index) / 2;
@@ -55,9 +55,9 @@ public void Bisect(string boot_title = "")
5555
UserInput return_val = BisectEvent(test_index);
5656

5757
if (return_val == UserInput.Yes)
58-
m_second_index = test_index - 1;
58+
m_first_index = test_index;
5959
else if (return_val == UserInput.No)
60-
m_first_index = test_index + 1;
60+
m_second_index = test_index;
6161
else
6262
return;
6363
}
@@ -66,7 +66,7 @@ public void Bisect(string boot_title = "")
6666

6767
if (open_url == UserInput.Yes)
6868
{
69-
Process.Start("https://dolp.in/" + m_build_list[test_index+1]);
69+
Process.Start("https://dolp.in/" + m_build_list[test_index-1]);
7070
}
7171
}
7272

DolphinBisectTool/MainWindow.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private UserInput BisectUserDialog(int build, bool final_trigger)
3535
}
3636
else
3737
{
38-
result = MessageBox.Show("Build " + m_build_list[build] + " may be the cause of your issue. " +
38+
result = MessageBox.Show("Build " + m_build_list[build-1] + " may be the cause of your issue. " +
3939
"Do you want to open the URL for that build?", "Notice",
4040
MessageBoxButtons.YesNo);
4141
start_button.Enabled = true;
@@ -70,19 +70,16 @@ private void browse_button_Click(object sender, EventArgs e)
7070

7171
private void start_button_Click(object sender, EventArgs e)
7272
{
73-
int first_build;
7473

75-
first_build = first_dev_build.SelectedIndex;
76-
77-
if (second_dev_build.SelectedIndex <= first_build)
74+
if (second_dev_build.SelectedIndex <= first_dev_build.SelectedIndex)
7875
{
7976
MessageBox.Show("Second build cannot be less than or equal to the first.", "Error", MessageBoxButtons.OK);
8077
return;
8178
}
8279

8380
start_button.Enabled = false;
8481

85-
Backend backend = new Backend(first_build, second_dev_build.SelectedIndex, m_build_list);
82+
Backend backend = new Backend(first_dev_build.SelectedIndex, second_dev_build.SelectedIndex, m_build_list);
8683
backend.BisectEvent += BisectUserDialog;
8784
backend.UpdateProgress += ChangeProgressBar;
8885

0 commit comments

Comments
 (0)