From 17ffacb6a0355ebee67007ea730c93c4f0d67e52 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 2 Dec 2012 13:34:32 -0800 Subject: [PATCH] Use iota rather than partial sum --- aegisub/src/dialog_selected_choices.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/aegisub/src/dialog_selected_choices.cpp b/aegisub/src/dialog_selected_choices.cpp index 969d76fd0..d354550cf 100644 --- a/aegisub/src/dialog_selected_choices.cpp +++ b/aegisub/src/dialog_selected_choices.cpp @@ -22,10 +22,6 @@ #include -#ifdef __VISUALC__ -#pragma warning(disable:4996) -#endif - SelectedChoicesDialog::SelectedChoicesDialog(wxWindow *parent, wxString const& message, wxString const& caption, wxArrayString const& choices) { Create(parent, message, caption, choices); @@ -44,9 +40,8 @@ SelectedChoicesDialog::SelectedChoicesDialog(wxWindow *parent, wxString const& m } void SelectedChoicesDialog::SelectAll(wxCommandEvent&) { - wxArrayInt sel(m_listbox->GetCount(), 1); - sel[0] = 0; - std::partial_sum(sel.begin(), sel.end(), sel.begin()); + wxArrayInt sel(m_listbox->GetCount()); + std::iota(sel.begin(), sel.end(), 0); SetSelections(sel); }