fixed bytes_saved for reporting negative values

pull/1/head
Clyne 4 years ago committed by GitHub
parent d2249cbbfa
commit e58cd38132
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -17,10 +17,10 @@
* @tparam data The string of data to be compressed. * @tparam data The string of data to be compressed.
* @tparam data_length The size in bytes of the data, defaults to using strlen(). * @tparam data_length The size in bytes of the data, defaults to using strlen().
*/ */
template<const char *data, std::size_t data_length = std::char_traits<char>::length(data)> template<const char *data, auto data_length = std::char_traits<char>::length(data)>
class huffman_compress class huffman_compress
{ {
using size_t = unsigned long int; using size_t = long int;
// Jump to the bottom of this header for the public-facing features of this // Jump to the bottom of this header for the public-facing features of this
// class. // class.
@ -274,7 +274,7 @@ public:
consteval static auto uncompressed_size() { consteval static auto uncompressed_size() {
return data_length; return data_length;
} }
consteval static auto bytes_saved() { consteval static size_t bytes_saved() {
return uncompressed_size() - compressed_size(); return uncompressed_size() - compressed_size();
} }

Loading…
Cancel
Save