Skip to content

Commit b53a116

Browse files
committed
specify that merge input is to be treated as a const
1 parent 4fff2c8 commit b53a116

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

include/sketch/sketch_columns.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class FixedSizeSketchColumn {
3434
void clear();
3535

3636
void update(const vec_t update);
37-
void merge(FixedSizeSketchColumn &other);
37+
void merge(FixedSizeSketchColumn const& other);
3838
uint8_t get_depth() const;
3939
void serialize(std::ostream &binary_out) const;
4040

@@ -98,7 +98,7 @@ class ResizeableSketchColumn {
9898
SketchSample<vec_t> sample() const;
9999
void clear();
100100
void update(const vec_t update);
101-
void merge(ResizeableSketchColumn &other);
101+
void merge(ResizeableSketchColumn const& other);
102102
uint8_t get_depth() const;
103103

104104
[[deprecated]]
@@ -166,7 +166,7 @@ class ResizeableAlignedSketchColumn {
166166
SketchSample<vec_t> sample() const;
167167
void clear();
168168
void update(const vec_t update);
169-
void merge(ResizeableAlignedSketchColumn &other);
169+
void merge(ResizeableAlignedSketchColumn const& other);
170170
uint8_t get_depth() const;
171171

172172
[[deprecated]]

src/sketch_columns.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void FixedSizeSketchColumn::clear() {
8282
deterministic_bucket = {0, 0};
8383
}
8484

85-
void FixedSizeSketchColumn::merge(FixedSizeSketchColumn &other) {
85+
void FixedSizeSketchColumn::merge(FixedSizeSketchColumn const& other) {
8686
for (size_t i = 0; i < capacity; ++i) {
8787
buckets[i] ^= other.buckets[i];
8888
}
@@ -202,7 +202,7 @@ void ResizeableSketchColumn::update(const vec_t update) {
202202
buckets[depth] ^= {update, checksum};
203203
}
204204

205-
void ResizeableSketchColumn::merge(ResizeableSketchColumn &other) {
205+
void ResizeableSketchColumn::merge(ResizeableSketchColumn const& other) {
206206
deterministic_bucket ^= other.deterministic_bucket;
207207
if (other.capacity > capacity) {
208208
reallocate(other.capacity);
@@ -295,7 +295,7 @@ void ResizeableAlignedSketchColumn::update(const vec_t update) {
295295
aligned_buckets[depth] ^= {update, checksum};
296296
}
297297

298-
void ResizeableAlignedSketchColumn::merge(ResizeableAlignedSketchColumn &other) {
298+
void ResizeableAlignedSketchColumn::merge(ResizeableAlignedSketchColumn const& other) {
299299
deterministic_bucket ^= other.deterministic_bucket;
300300
if (other.capacity > capacity) {
301301
reallocate(other.capacity);

0 commit comments

Comments
 (0)