Skip to content

Commit 5c521a7

Browse files
nicola-cabjedelbo
authored andcommitted
remove set_direct methods from integer compressors
1 parent 459fd9e commit 5c521a7

File tree

4 files changed

+2
-33
lines changed

4 files changed

+2
-33
lines changed

src/realm/integer_compressor.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,6 @@ void IntegerCompressor::get_chunk_flex(const Array& arr, size_t ndx, int64_t res
221221
FlexCompressor::get_chunk(arr.m_integer_compressor, ndx, res);
222222
}
223223

224-
void IntegerCompressor::set_packed(Array& arr, size_t ndx, int64_t val)
225-
{
226-
PackedCompressor::set_direct(arr.m_integer_compressor, ndx, val);
227-
}
228-
229-
void IntegerCompressor::set_flex(Array& arr, size_t ndx, int64_t val)
230-
{
231-
FlexCompressor::set_direct(arr.m_integer_compressor, ndx, val);
232-
}
233-
234224
template <class Cond>
235225
bool IntegerCompressor::find_packed(const Array& arr, int64_t val, size_t begin, size_t end, size_t base_index,
236226
QueryStateBase* st)
@@ -250,7 +240,7 @@ void IntegerCompressor::set_vtable(Array& arr)
250240
static const Array::VTable vtable_packed = {get_packed,
251241
get_chunk_packed,
252242
get_all_packed,
253-
set_packed,
243+
nullptr,
254244
{
255245
find_packed<Equal>,
256246
find_packed<NotEqual>,
@@ -260,7 +250,7 @@ void IntegerCompressor::set_vtable(Array& arr)
260250
static const Array::VTable vtable_flex = {get_flex,
261251
get_chunk_flex,
262252
get_all_flex,
263-
set_flex,
253+
nullptr,
264254
{
265255
find_flex<Equal>,
266256
find_flex<NotEqual>,

src/realm/integer_compressor.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ class IntegerCompressor {
7070

7171
static void get_chunk_packed(const Array& arr, size_t ndx, int64_t res[8]);
7272
static void get_chunk_flex(const Array& arr, size_t ndx, int64_t res[8]);
73-
static void set_packed(Array& arr, size_t ndx, int64_t val);
74-
static void set_flex(Array& arr, size_t ndx, int64_t val);
7573
// query interface
7674
template <class Cond>
7775
static bool find_packed(const Array& arr, int64_t val, size_t begin, size_t end, size_t base_index,

src/realm/integer_flex_compressor.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class FlexCompressor {
4040
static int64_t get(const IntegerCompressor&, size_t);
4141
static std::vector<int64_t> get_all(const IntegerCompressor&, size_t, size_t);
4242
static void get_chunk(const IntegerCompressor&, size_t, int64_t[8]);
43-
static void set_direct(const IntegerCompressor&, size_t, int64_t);
4443

4544
template <typename Cond>
4645
static bool find_all(const Array&, int64_t, size_t, size_t, size_t, QueryStateBase*);
@@ -142,17 +141,6 @@ inline void FlexCompressor::get_chunk(const IntegerCompressor& c, size_t ndx, in
142141
}
143142
}
144143

145-
inline void FlexCompressor::set_direct(const IntegerCompressor& c, size_t ndx, int64_t value)
146-
{
147-
const auto offset = c.v_width() * c.v_size();
148-
const auto ndx_w = c.ndx_width();
149-
const auto v_w = c.v_width();
150-
const auto data = c.data();
151-
BfIterator ndx_iterator{data, offset, ndx_w, ndx_w, ndx};
152-
BfIterator data_iterator{data, 0, v_w, v_w, static_cast<size_t>(*ndx_iterator)};
153-
data_iterator.set_value(value);
154-
}
155-
156144
template <typename T>
157145
class IndexCond {
158146
public:

src/realm/integer_packed_compressor.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class PackedCompressor {
4040
static int64_t get(const IntegerCompressor&, size_t);
4141
static std::vector<int64_t> get_all(const IntegerCompressor& c, size_t b, size_t e);
4242
static void get_chunk(const IntegerCompressor&, size_t, int64_t res[8]);
43-
static void set_direct(const IntegerCompressor&, size_t, int64_t);
4443

4544
template <typename Cond>
4645
static bool find_all(const Array&, int64_t, size_t, size_t, size_t, QueryStateBase*);
@@ -100,12 +99,6 @@ inline std::vector<int64_t> PackedCompressor::get_all(const IntegerCompressor& c
10099
return res;
101100
}
102101

103-
inline void PackedCompressor::set_direct(const IntegerCompressor& c, size_t ndx, int64_t value)
104-
{
105-
BfIterator it{c.data(), 0, c.v_width(), c.v_width(), ndx};
106-
it.set_value(value);
107-
}
108-
109102
inline void PackedCompressor::get_chunk(const IntegerCompressor& c, size_t ndx, int64_t res[8])
110103
{
111104
auto sz = 8;

0 commit comments

Comments
 (0)