Skip to content

Commit

Permalink
Removed util::assign. We can use std
Browse files Browse the repository at this point in the history
  • Loading branch information
simongog committed Dec 2, 2016
1 parent dbc9f33 commit 8054784
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 29 deletions.
2 changes: 1 addition & 1 deletion include/sdsl/bp_support_gg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class bp_support_gg
{
bit_vector pioneer;
pioneer = calculate_pioneers_bitmap_succinct(*m_bp, t_bs);
util::assign(m_nnd, nnd_type(pioneer));
m_nnd = nnd_type(pioneer);
}

m_pioneer_bp.resize(m_nnd.ones());
Expand Down
2 changes: 1 addition & 1 deletion include/sdsl/csa_sampling_strategy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ class _bwt_sampling : public int_vector<t_width>
base_type::operator[](sa_cnt++) = sa;
}
}
util::assign(m_marked, marked);
m_marked = std::move(marked);
util::init_support(m_rank_marked, &m_marked);
}

Expand Down
2 changes: 1 addition & 1 deletion include/sdsl/sd_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class sd_vector
w >>= 1;
}
}
util::assign(m_high, high);
m_high = std::move(high);
util::init_support(m_high_1_select, &m_high);
util::init_support(m_high_0_select, &m_high);
}
Expand Down
23 changes: 0 additions & 23 deletions include/sdsl/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,29 +255,6 @@ std::string to_latex_string(unsigned char c);
//! Delete all files of the file_map.
void delete_all_files(tMSS& file_map);

// thanks to Stefan Arnold for the assign functions
//! Assigns the value x of type T to the value of y of type U.
/*!
* \param x The assigned variable.
* \param y The variable which provides the value that is assigned to x.
*/
template<class T, class U>
void assign(T& x, const U& y)
{
x = T(y);
}

//! Swaps variables x and y.
/*!
* \param x Reference to the first variable.
* \param y Reference to the second variable.
*/
template<class T>
void assign(T& x, T& y)
{
std::swap(x,y);
}

//! clear the space used by x
/*!
* \param x Reference to the data structure.
Expand Down
6 changes: 3 additions & 3 deletions lib/csa_alphabet_strategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ byte_alphabet::byte_alphabet(int_vector_buffer<8>& text_buf, int_vector_size_typ
return;
assert(len <= text_buf.size());
// initialize vectors
util::assign(m_C , int_vector<64>(257, 0));
util::assign(m_char2comp, int_vector<8>(256,0));
util::assign(m_comp2char, int_vector<8>(256,0));
m_C = int_vector<64>(257, 0);
m_char2comp = int_vector<8>(256,0);
m_comp2char = int_vector<8>(256,0);
// count occurrences of each symbol
for (size_type i=0; i < len; ++i) {
++m_C[text_buf[i]];
Expand Down

0 comments on commit 8054784

Please sign in to comment.