Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-06-09 12:58:47 +0300
committerJacques Lucke <jacques@blender.org>2020-06-09 12:58:47 +0300
commitf7c0f1b8b83ac475755b633abf59cf9f447b2d49 (patch)
tree97302f741ce4e40f6e4de9f0cfd54c7320ee7fd5 /source/blender/blenlib/intern/BLI_index_range.cc
parent7d2b4ae9c6ecce394130cd08694914bf93497a11 (diff)
BLI: rename ArrayRef to Span
This also renames `MutableArrayRef` to `MutableSpan`. The name "Span" works better, because `std::span` will provide similar functionality in C++20. Furthermore, a shorter, more concise name for a common data structure is nice.
Diffstat (limited to 'source/blender/blenlib/intern/BLI_index_range.cc')
-rw-r--r--source/blender/blenlib/intern/BLI_index_range.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/BLI_index_range.cc b/source/blender/blenlib/intern/BLI_index_range.cc
index 31b969ec0b3..910e418a29b 100644
--- a/source/blender/blenlib/intern/BLI_index_range.cc
+++ b/source/blender/blenlib/intern/BLI_index_range.cc
@@ -18,8 +18,8 @@
#include <mutex>
#include "BLI_array.hh"
-#include "BLI_array_ref.hh"
#include "BLI_index_range.hh"
+#include "BLI_span.hh"
#include "BLI_vector.hh"
namespace blender {
@@ -29,18 +29,18 @@ static uint current_array_size = 0;
static uint *current_array = nullptr;
static std::mutex current_array_mutex;
-ArrayRef<uint> IndexRange::as_array_ref() const
+Span<uint> IndexRange::as_span() const
{
uint min_required_size = m_start + m_size;
if (min_required_size <= current_array_size) {
- return ArrayRef<uint>(current_array + m_start, m_size);
+ return Span<uint>(current_array + m_start, m_size);
}
std::lock_guard<std::mutex> lock(current_array_mutex);
if (min_required_size <= current_array_size) {
- return ArrayRef<uint>(current_array + m_start, m_size);
+ return Span<uint>(current_array + m_start, m_size);
}
uint new_size = std::max<uint>(1000, power_of_2_max_u(min_required_size));
@@ -54,7 +54,7 @@ ArrayRef<uint> IndexRange::as_array_ref() const
std::atomic_thread_fence(std::memory_order_seq_cst);
current_array_size = new_size;
- return ArrayRef<uint>(current_array + m_start, m_size);
+ return Span<uint>(current_array + m_start, m_size);
}
} // namespace blender