[Bf-blender-cvs] [23b52a19589] functions: remove unused class
Jacques Lucke
noreply at git.blender.org
Mon Feb 10 13:32:31 CET 2020
Commit: 23b52a19589b4b2358bce6f1cc468748a6312f89
Author: Jacques Lucke
Date: Mon Feb 10 13:24:46 2020 +0100
Branches: functions
https://developer.blender.org/rB23b52a19589b4b2358bce6f1cc468748a6312f89
remove unused class
===================================================================
D source/blender/blenlib/BLI_multi_vector.h
M source/blender/blenlib/CMakeLists.txt
D tests/gtests/blenlib/BLI_multi_vector_test.cc
M tests/gtests/blenlib/CMakeLists.txt
===================================================================
diff --git a/source/blender/blenlib/BLI_multi_vector.h b/source/blender/blenlib/BLI_multi_vector.h
deleted file mode 100644
index ef6e22601d3..00000000000
--- a/source/blender/blenlib/BLI_multi_vector.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-/** \file
- * \ingroup bli
- *
- * A vector that can group consecutive elements. This is much more efficient than allocating many
- * vectors separately.
- *
- * Note: the number of elements per group cannot be changed cheaply afterwards.
- */
-
-#pragma once
-
-#include "BLI_array_ref.h"
-#include "BLI_vector.h"
-
-namespace BLI {
-
-template<typename T, uint N = 4> class MultiVector {
- private:
- Vector<T, N> m_elements;
- Vector<uint> m_starts;
-
- public:
- MultiVector() : m_starts({0})
- {
- }
-
- void append(ArrayRef<T> values)
- {
- m_elements.extend(values);
- m_starts.append(m_elements.size());
- }
-
- uint size() const
- {
- return m_starts.size() - 1;
- }
-
- ArrayRef<T> operator[](uint index)
- {
- uint start = m_starts[index];
- uint one_after_end = m_starts[index + 1];
- uint size = one_after_end - start;
- return ArrayRef<T>(m_elements.begin() + start, size);
- }
-};
-
-} // namespace BLI
diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt
index c0cca1ed213..753b35c0048 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -265,7 +265,6 @@ set(SRC
BLI_multi_map.h
BLI_timeit.h
BLI_vector_adaptor.h
- BLI_multi_vector.h
BLI_utility_mixins.h
BLI_static_class_ids.h
BLI_index_mask.h
diff --git a/tests/gtests/blenlib/BLI_multi_vector_test.cc b/tests/gtests/blenlib/BLI_multi_vector_test.cc
deleted file mode 100644
index 98f5be08255..00000000000
--- a/tests/gtests/blenlib/BLI_multi_vector_test.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "testing/testing.h"
-#include "BLI_multi_vector.h"
-
-using namespace BLI;
-
-using IntMultiVector = MultiVector<int>;
-
-TEST(multi_vector, DefaultConstructor)
-{
- IntMultiVector vec;
- EXPECT_EQ(vec.size(), 0);
-}
-
-TEST(multi_vector, Append)
-{
- IntMultiVector vec;
- vec.append({4, 5, 6});
- EXPECT_EQ(vec.size(), 1);
- EXPECT_EQ(vec[0].size(), 3);
-}
diff --git a/tests/gtests/blenlib/CMakeLists.txt b/tests/gtests/blenlib/CMakeLists.txt
index 43ad74203eb..153613dc388 100644
--- a/tests/gtests/blenlib/CMakeLists.txt
+++ b/tests/gtests/blenlib/CMakeLists.txt
@@ -62,7 +62,6 @@ BLENDER_TEST(BLI_math_geom "bf_blenlib")
BLENDER_TEST(BLI_memiter "bf_blenlib")
BLENDER_TEST(BLI_linear_allocator "bf_blenlib")
BLENDER_TEST(BLI_multi_map "bf_blenlib")
-BLENDER_TEST(BLI_multi_vector "bf_blenlib")
BLENDER_TEST(BLI_optional "bf_blenlib")
BLENDER_TEST(BLI_path_util "${BLI_path_util_extra_libs}")
BLENDER_TEST(BLI_polyfill_2d "bf_blenlib")
More information about the Bf-blender-cvs
mailing list