Skip to content

Commit

Permalink
Use data member chunk_size at least once for static code analyser
Browse files Browse the repository at this point in the history
  • Loading branch information
auto-differentiation-dev committed Nov 25, 2024
1 parent 2fe78c7 commit 88b70d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/XAD/OperationsContainer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class OperationsContainer

XAD_FORCE_INLINE void push_back_unsafe(T multiplier, S slot)
{
if (XAD_VERY_UNLIKELY(idx_ == ChunkSize))
if (XAD_VERY_UNLIKELY(idx_ == chunk_size))
{
++chunk_;
idx_ = 0;
Expand All @@ -147,7 +147,7 @@ class OperationsContainer
template <class MulIt, class SlotIt>
XAD_FORCE_INLINE void append_n(MulIt muls, SlotIt slots, size_type n)
{
auto items = (std::min)(chunk_size - idx_, n);
auto items = (std::min)(ChunkSize - idx_, n);
std::uninitialized_copy_n(detail::make_checked(muls, items), items,
detail::make_checked(mul_chunk(chunk_), ChunkSize) + idx_);
std::uninitialized_copy_n(detail::make_checked(slots, items), items,
Expand Down
4 changes: 2 additions & 2 deletions src/XAD/OperationsContainerPaired.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class OperationsContainerPaired
~OperationsContainerPaired() { destruct_elements(0); }

bool empty() const { return chunk_ == 0 && idx_ == 0; }
size_type size() const { return chunk_ * ChunkSize + idx_; }
size_type capacity() const { return chunks_.size() * ChunkSize; }
size_type size() const { return chunk_ * chunk_size + idx_; }
size_type capacity() const { return chunks_.size() * chunk_size; }
size_type chunks() const { return chunks_.size(); }

void reserve(size_type s)
Expand Down

0 comments on commit 88b70d3

Please sign in to comment.