Skip to content

Commit de803fa

Browse files
committed
cleanup(Cx::Table::ensize()): o7
Issue #32
1 parent fe0303e commit de803fa

3 files changed

Lines changed: 5 additions & 9 deletions

File tree

src/cx/table.hh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ public:
5454
this->insert(this->end(), capac, e);
5555
}
5656

57-
void ensize(size_t capac) {
58-
this->resize(capac);
59-
}
6057
void wipe(const T& x) {this->assign(this->size(), x);}
6158

6259
T* operator+() {return this->data();}

src/mpidissem.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,10 @@ MpiDissem::xtestlite(Tag& tag, Cx::Table<uint>& msg)
9393
payload.cpop();
9494
const uint n = payload.top();
9595

96-
msg.flush();
97-
msg.ensize(n);
98-
for (uint j = 0; j < n; ++j) {
96+
msg.resize(n);
97+
for (auto& e : msg) {
9998
payload.cpop();
100-
msg[j] = payload.top();
99+
e = payload.top();
101100
}
102101
// Use the last pop to resize in memory.
103102
payload.mpop();

src/uni/livelock.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fill_livelock_ck(const PcState top[],
6666
Claim( top[0] == col[0] );
6767
Claim( top[0] == col[m] );
6868
Claim( top[0] == top[n] );
69-
row.ensize(n+1);
69+
row.resize(n+1);
7070
for (uint j = 0; j < n+1; ++j) {
7171
row[j] = top[j];
7272
}
@@ -121,7 +121,7 @@ livelock_semick_rec(const Table<PcState>& old_bot,
121121
if (fill_livelock_ck(&bot[j], bot.sz()-1-j,
122122
&col[i], col.sz()-1-i,
123123
ppgfun, domsz, ret_row)) {
124-
ret_col.ensize(n+1-i);
124+
ret_col.resize(n+1-i);
125125
for (uint j = 0; j < ret_col.sz(); ++j) {
126126
ret_col[j] = col[i+j];
127127
}

0 commit comments

Comments
 (0)