diff --git a/include/bitlib/bit-algorithms/bit_algorithm_details.hpp b/include/bitlib/bit-algorithms/bit_algorithm_details.hpp index da6a0dc..96267ad 100644 --- a/include/bitlib/bit-algorithms/bit_algorithm_details.hpp +++ b/include/bitlib/bit-algorithms/bit_algorithm_details.hpp @@ -288,7 +288,6 @@ RandomAccessIt word_shift_left(RandomAccessIt first, if (n >= distance(first, last)) return first; RandomAccessIt mid = first + n; auto ret = std::move(mid, last, first); - //std::fill(ret, last, 0); return ret; } @@ -305,12 +304,7 @@ ForwardIt word_shift_right_dispatch(ForwardIt first, auto d = distance(first, last); if (n <= 0) return first; if (n >= d) return last; - ForwardIt it = first; - std::advance(it, d-n); - std::rotate(first, it, last); - it = first; - std::advance(it, n); - std::fill(first, it, 0); + std::move_backward(first, last, last - n); return std::next(first, n); }