Skip to content

Commit

Permalink
adopted the reviewer's suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
evgueni-ovtchinnikov committed Dec 12, 2024
1 parent c3b25d6 commit 3ff116d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
17 changes: 2 additions & 15 deletions src/buildblock/ProjDataInMemory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,8 @@ ProjDataInMemory::ProjDataInMemory(shared_ptr<const ExamInfo> const& exam_info_s
void
ProjDataInMemory::create_buffer(const bool initialise_with_0)
{
if (!initialise_with_0)
{
this->buffer.set_initialise_with_zeros(false);
this->buffer.grow(0, this->size_all() - 1);
return;
}
#if 0
float *b = new float[this->size_all()];
if (initialise_with_0)
memset(b, 0, this->size_all()*sizeof(float));
return b;
#else
this->buffer.set_initialise_with_zeros(true);
this->buffer = Array<1, float>(static_cast<int>(this->size_all()));
#endif
this->buffer.set_initialise_with_zeros(initialise_with_0);
this->buffer.grow(0, this->size_all() - 1);
}

///////////////// /set functions
Expand Down
2 changes: 1 addition & 1 deletion src/include/stir/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ class Array<1, elemT> : public NumericVectorWithOffset<elemT, elemT>
*/
inline void init(const IndexRange<1>& range, elemT* const data_ptr, bool copy_data);

bool init_with_zeros_ = 1;
bool init_with_zeros_ = true;
};

END_NAMESPACE_STIR
Expand Down

0 comments on commit 3ff116d

Please sign in to comment.