diff options
author | Jacques Lucke <jacques@blender.org> | 2020-07-03 15:52:51 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-07-03 15:53:06 +0300 |
commit | 93da09d717ff4502975c506c574faf0c07f010b4 (patch) | |
tree | 5496c001844cf557be525c08a6ef830998368d3d /source/blender/blenlib/BLI_stack.hh | |
parent | 9dce2c9d1432d2798854b909e6262fbfb94ce3c7 (diff) |
Cleanup: add const in various places
Diffstat (limited to 'source/blender/blenlib/BLI_stack.hh')
-rw-r--r-- | source/blender/blenlib/BLI_stack.hh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/BLI_stack.hh b/source/blender/blenlib/BLI_stack.hh index 021fa43ed7d..50be9357a01 100644 --- a/source/blender/blenlib/BLI_stack.hh +++ b/source/blender/blenlib/BLI_stack.hh @@ -296,8 +296,8 @@ class Stack { this->activate_next_chunk(remaining_values.size()); } - uint remaining_capacity = top_chunk_->capacity_end - top_; - uint amount = std::min(remaining_values.size(), remaining_capacity); + const uint remaining_capacity = top_chunk_->capacity_end - top_; + const uint amount = std::min(remaining_values.size(), remaining_capacity); uninitialized_copy_n(remaining_values.data(), amount, top_); top_ += amount; @@ -347,11 +347,11 @@ class Stack { * * This invokes undefined behavior when the currently active chunk is not full. */ - void activate_next_chunk(uint size_hint) + void activate_next_chunk(const uint size_hint) { BLI_assert(top_ == top_chunk_->capacity_end); if (top_chunk_->above == nullptr) { - uint new_capacity = std::max(size_hint, top_chunk_->capacity() * 2 + 10); + const uint new_capacity = std::max(size_hint, top_chunk_->capacity() * 2 + 10); /* Do a single memory allocation for the Chunk and the array it references. */ void *buffer = allocator_.allocate( |