forked from mia/Aegisub
Use iota rather than partial sum
This commit is contained in:
parent
de4ef14598
commit
17ffacb6a0
1 changed files with 2 additions and 7 deletions
|
@ -22,10 +22,6 @@
|
||||||
|
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
#ifdef __VISUALC__
|
|
||||||
#pragma warning(disable:4996)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SelectedChoicesDialog::SelectedChoicesDialog(wxWindow *parent, wxString const& message, wxString const& caption, wxArrayString const& choices) {
|
SelectedChoicesDialog::SelectedChoicesDialog(wxWindow *parent, wxString const& message, wxString const& caption, wxArrayString const& choices) {
|
||||||
Create(parent, message, caption, choices);
|
Create(parent, message, caption, choices);
|
||||||
|
|
||||||
|
@ -44,9 +40,8 @@ SelectedChoicesDialog::SelectedChoicesDialog(wxWindow *parent, wxString const& m
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectedChoicesDialog::SelectAll(wxCommandEvent&) {
|
void SelectedChoicesDialog::SelectAll(wxCommandEvent&) {
|
||||||
wxArrayInt sel(m_listbox->GetCount(), 1);
|
wxArrayInt sel(m_listbox->GetCount());
|
||||||
sel[0] = 0;
|
std::iota(sel.begin(), sel.end(), 0);
|
||||||
std::partial_sum(sel.begin(), sel.end(), sel.begin());
|
|
||||||
SetSelections(sel);
|
SetSelections(sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue