Skip to content

Commit

Permalink
oof
Browse files Browse the repository at this point in the history
unsigned being 32bit was doing some heavy lifting here... but let's be
explicit.
  • Loading branch information
sz3 committed Feb 18, 2022
1 parent 28559cb commit 82ed9e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/lib/fountain/FountainMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class FountainMetadata
}

public:
FountainMetadata(uint64_t id)
FountainMetadata(uint32_t id)
: _data(id)
{
}
Expand All @@ -33,7 +33,7 @@ class FountainMetadata
to_uint8_arr(encode_id, size, d);
}

uint64_t id() const
uint32_t id() const
{
return _data;
}
Expand Down Expand Up @@ -65,5 +65,5 @@ class FountainMetadata
}

protected:
uint64_t _data; // might invert this and only generate the uint64_t when we need it
uint32_t _data; // might invert this and only generate the uint32_t when we need it
};
8 changes: 4 additions & 4 deletions src/lib/fountain/fountain_decoder_sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class fountain_decoder_sink
std::vector<std::string> get_done() const
{
std::vector<std::string> done;
for (uint64_t id : _done)
for (uint32_t id : _done)
done.push_back( get_filename(FountainMetadata(id)) );
return done;
}
Expand All @@ -77,7 +77,7 @@ class fountain_decoder_sink
return progress;
}

bool is_done(uint64_t id) const
bool is_done(uint32_t id) const
{
return _done.find(id) != _done.end();
}
Expand Down Expand Up @@ -141,6 +141,6 @@ class fountain_decoder_sink
// e.g. most recent 16/8, or something?
// question is what happens to _done/_streams when we wrap for continuous data streaming...
std::unordered_map<uint8_t, fountain_decoder_stream> _streams;
// track the uint64_t combo of (encode_id,size) to avoid redundant work
std::set<uint64_t> _done;
// track the uint32_t combo of (encode_id,size) to avoid redundant work
std::set<uint32_t> _done;
};

0 comments on commit 82ed9e9

Please sign in to comment.