Skip to content

Commit

Permalink
commit before updating to master
Browse files Browse the repository at this point in the history
  • Loading branch information
ianna committed Jan 20, 2022
1 parent 5c08fc1 commit 4b9a541
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/libawkward/builder/ArrayBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ namespace awkward {

void
ArrayBuilder::clear() {
builder_.get()->clear();
if (builder_) {
builder_.get()->clear();
}
}

void
Expand Down
2 changes: 1 addition & 1 deletion src/libawkward/builder/BoolBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace awkward {

container.copy_buffer(form_key.str() + "-data",
buffer_.ptr().get(),
buffer_.length() * (int64_t)sizeof(bool));
(int64_t)(buffer_.length() * sizeof(bool)));

return "{\"class\": \"NumpyArray\", \"primitive\": \"bool\", \"form_key\": \""
+ form_key.str() + "\"}";
Expand Down
2 changes: 1 addition & 1 deletion src/libawkward/builder/GrowableBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ namespace awkward {
GrowableBuffer<T>::clear() {
length_ = 0;
reserved_ = (size_t) options_.initial();
ptr_ = nullptr;
ptr_ = UniquePtr(reinterpret_cast<T*>(awkward_malloc(options_.initial()*(int64_t)sizeof(T))));
}

template <typename T>
Expand Down

0 comments on commit 4b9a541

Please sign in to comment.