Skip to content

Commit 412a6b9

Browse files
committed
UPD | slices #3
1 parent 012c204 commit 412a6b9

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/std/ManapiSlice.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ manapi::status manapi::slice_base::rshift_add_(std::size_t s) MANAPIHTTP_NOEXCEP
601601

602602
if (this->count) {
603603
this->last = parts[this->count - 1];
604+
this->last->next = nullptr;
604605
}
605606
else {
606607
assert(this->shift_ == 0);
@@ -800,7 +801,8 @@ manapi::status manapi::slice::resize(std::size_t size) MANAPIHTTP_NOEXCEPT {
800801
return status_ok();
801802

802803
if (size < cur) {
803-
assert(this->rshift_add_(cur - size).ok());
804+
auto res = this->rshift_add_(cur - size).ok();
805+
assert(res);
804806
}
805807
else {
806808
size -= cur;

tests/test_slice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ UTEST(slice, slice_pop) {
4848
if (i != c.size() - 1)
4949
s.append(c[i]);
5050
}
51-
b.resize(b.size() - c[2].size());
51+
b.resize(b.size() - c[2].size()).unwrap();
5252
ASSERT_TRUE(!b.cmp(s.data(), s.size()));
5353
}
5454
manapi::async::run(ctx->stop());

0 commit comments

Comments
 (0)