Skip to content

Commit dbbfdc8

Browse files
committed
fixed inconsistency introduced in cbcbbcb
1 parent f4cfaef commit dbbfdc8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

include/sdsl/construct.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void append_zero_symbol(int_vector& text)
5454

5555

5656
template<class t_index>
57-
void construct(t_index& idx, const std::string &file, uint8_t num_bytes=0)
57+
void construct(t_index& idx, const std::string& file, uint8_t num_bytes=0)
5858
{
5959
tMSS file_map;
6060
cache_config config;
@@ -65,7 +65,7 @@ void construct(t_index& idx, const std::string &file, uint8_t num_bytes=0)
6565
}
6666

6767
template<class t_index, class t_data>
68-
void construct_im(t_index& idx, const t_data &data, uint8_t num_bytes=0)
68+
void construct_im(t_index& idx, const t_data& data, uint8_t num_bytes=0)
6969
{
7070
std::string tmp_file = ram_file_name(util::to_string(util::pid())+"_"+util::to_string(util::id()));
7171
store_to_file(data, tmp_file);
@@ -98,7 +98,7 @@ void construct(t_index& idx, const std::string& file, cache_config& config, uint
9898
auto event = memory_monitor::event("construct wavelet tree");
9999
if ((t_index::alphabet_category::WIDTH==8 and num_bytes <= 1)
100100
or (t_index::alphabet_category::WIDTH==0 and num_bytes != 'd')) {
101-
int_vector_buffer<> text_buf(file, std::ios::in, 1024*1024, num_bytes*8, (bool)num_bytes);
101+
int_vector_buffer<t_index::alphabet_category::WIDTH> text_buf(file, std::ios::in, 1024*1024, num_bytes*8, (bool)num_bytes);
102102
t_index tmp(text_buf, text_buf.size());
103103
idx.swap(tmp);
104104
} else {
@@ -109,7 +109,7 @@ void construct(t_index& idx, const std::string& file, cache_config& config, uint
109109
store_to_file(text, tmp_file_name);
110110
util::clear(text);
111111
{
112-
int_vector_buffer<> text_buf(tmp_file_name);
112+
int_vector_buffer<t_index::alphabet_category::WIDTH> text_buf(tmp_file_name);
113113
t_index tmp(text_buf, text_buf.size());
114114
idx.swap(tmp);
115115
}

include/sdsl/int_vector.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,8 @@ class int_vector
595595
{
596596
uint64_t written_bytes = write_member(size, out);
597597
if (0 == t_width) {
598+
// FYI: int_vector_buffer<> can't read from int_vector_buffer<width>
599+
// fix this by always writing the width?
598600
written_bytes += write_member(int_width, out);
599601
}
600602
return written_bytes;

0 commit comments

Comments
 (0)