commit 3952312eb70f648b03a75058cf83f4088c7a4853
parent 811a6999c4ec80658b793e614c8bc9c79b8a5754
Author: cfillion <cfillion@users.noreply.github.com>
Date: Mon, 24 Feb 2020 16:57:47 -0500
use structured binding declarations when reading serialized data
Diffstat:
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/dialog.cpp b/src/dialog.cpp
@@ -375,15 +375,14 @@ void Dialog::restoreState(Serializer::Data &data)
return;
auto it = data.begin();
-
- const auto &pos = *it++;
- const auto &size = *it++;
+ const auto &[x, y] = *it++;
+ const auto &[width, height] = *it++;
SetWindowPos(m_handle, nullptr, 0, 0,
- size[0], size[1], SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
+ width, height, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
onResize();
- boundedMove(pos[0], pos[1]);
+ boundedMove(x, y);
data.erase(data.begin(), it);
}
diff --git a/src/listview.cpp b/src/listview.cpp
@@ -650,10 +650,7 @@ void ListView::restoreState(Serializer::Data &data)
std::vector<int> order(columnCount());
while(!data.empty()) {
- const Serializer::Record &rec = data.front();
-
- const int left = rec[0];
- const int right = rec[1];
+ const auto &[left, right] = data.front();
switch(col) {
case -1: // sort