Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
8f342120
Commit
8f342120
authored
Apr 08, 2015
by
Fabio Bas
Browse files
Optimize loop; refers #910
parent
869d89df
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/decklistmodel.cpp
View file @
8f342120
...
...
@@ -307,11 +307,12 @@ void DeckListModel::sortHelper(InnerDecklistNode *node, Qt::SortOrder order)
QVector
<
QPair
<
int
,
int
>
>
sortResult
=
node
->
sort
(
order
);
QModelIndexList
from
,
to
;
int
columns
=
columnCount
();
for
(
int
i
=
sortResult
.
size
()
-
1
;
i
>=
0
;
--
i
)
{
const
int
fromRow
=
sortResult
[
i
].
first
;
const
int
toRow
=
sortResult
[
i
].
second
;
AbstractDecklistNode
*
temp
=
node
->
at
(
toRow
);
for
(
int
j
=
0
;
j
<
column
Count
()
;
++
j
)
{
for
(
int
j
=
0
;
j
<
column
s
;
++
j
)
{
from
<<
createIndex
(
fromRow
,
j
,
temp
);
to
<<
createIndex
(
toRow
,
j
,
temp
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment