mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 14:30:36 +00:00
use do while instead of for loop
This commit is contained in:
parent
65863e76b6
commit
bd3bf1d277
2 changed files with 6 additions and 6 deletions
|
|
@ -161,13 +161,13 @@ class LDPCDecoder
|
|||
shift[c] = (shift[c] + 1) % M;
|
||||
}
|
||||
std::sort(lo, lo + cnt, [](const Loc &a, const Loc &b){ return a.off < b.off; });
|
||||
bool wd[deg];
|
||||
bool wd[deg], repeat;
|
||||
for (int d = 0; d < deg; ++d)
|
||||
wd[d] = false;
|
||||
for (int c = 1; c < cnt; ++c)
|
||||
if (lo[c].off == lo[c-1].off)
|
||||
wd[c] = true;
|
||||
for (bool repeat = true; repeat;) {
|
||||
do {
|
||||
TYPE par[2];
|
||||
if (i) {
|
||||
par[0] = pty[W*(i-1)+j];
|
||||
|
|
@ -217,7 +217,7 @@ class LDPCDecoder
|
|||
repeat = true;
|
||||
++c;
|
||||
}
|
||||
}
|
||||
} while (repeat);
|
||||
bl += deg;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,13 +142,13 @@ class LDPCDecoder
|
|||
int cnt = cnc[i];
|
||||
int deg = cnt + 2;
|
||||
for (int j = 0; j < W; ++j) {
|
||||
bool wd[deg];
|
||||
bool wd[deg], repeat;
|
||||
for (int d = 0; d < deg; ++d)
|
||||
wd[d] = false;
|
||||
for (int c = 1; c < cnt; ++c)
|
||||
if (lo[c].off == lo[c-1].off)
|
||||
wd[c] = true;
|
||||
for (bool repeat = true; repeat;) {
|
||||
do {
|
||||
TYPE par[2];
|
||||
if (i) {
|
||||
par[0] = pty[W*(i-1)+j];
|
||||
|
|
@ -198,7 +198,7 @@ class LDPCDecoder
|
|||
repeat = true;
|
||||
++c;
|
||||
}
|
||||
}
|
||||
} while (repeat);
|
||||
lo += cnt;
|
||||
bl += deg;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue