OSDN Git Service
(root)
/
kde
/
Katie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
baae1d6
)
replace QTest::swap() with its body
author
Ivailo Monev
<xakepa10@gmail.com>
Fri, 14 Aug 2020 20:57:10 +0000
(23:57 +0300)
committer
Ivailo Monev
<xakepa10@gmail.com>
Fri, 14 Aug 2020 20:57:10 +0000
(23:57 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/test/qtestcase.cpp
patch
|
blob
|
history
diff --git
a/src/test/qtestcase.cpp
b/src/test/qtestcase.cpp
index
ccf8964
..
658996c
100644
(file)
--- a/
src/test/qtestcase.cpp
+++ b/
src/test/qtestcase.cpp
@@
-950,19
+950,13
@@
void seedRandom()
}
template<typename T>
-void swap(T * array, int pos, int otherPos)
-{
- T tmp = array[pos];
- array[pos] = array[otherPos];
- array[otherPos] = tmp;
-}
-
-template<typename T>
static void randomizeList(T * array, int size)
{
for (int i = 0; i != size; i++) {
int pos = qrand() % size;
- swap(array, pos, i);
+ T tmp = array[pos];
+ array[pos] = array[i];
+ array[i] = tmp;
}
}