removed bettercode

This commit is contained in:
Phuntsok Drak-pa 2018-06-09 02:50:14 +02:00
parent cbd6d89234
commit d901cd60f2
4 changed files with 8 additions and 14 deletions

View File

@ -1,6 +0,0 @@
component_depth: 2
languages:
- cpp
exclude:
- .*\.h
- .*\.c

View File

@ -3,7 +3,6 @@
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/80cf9a0514554f368effaf78d8e4ae15)](https://www.codacy.com/app/Phundrak/lzw-assignment?utm_source=github.com&utm_medium=referral&utm_content=Phundrak/lzw-assignment&utm_campaign=Badge_Grade) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/80cf9a0514554f368effaf78d8e4ae15)](https://www.codacy.com/app/Phundrak/lzw-assignment?utm_source=github.com&utm_medium=referral&utm_content=Phundrak/lzw-assignment&utm_campaign=Badge_Grade)
[![CodeFactor](https://www.codefactor.io/repository/github/phundrak/lzw-assignment/badge)](https://www.codefactor.io/repository/github/phundrak/lzw-assignment) [![CodeFactor](https://www.codefactor.io/repository/github/phundrak/lzw-assignment/badge)](https://www.codefactor.io/repository/github/phundrak/lzw-assignment)
[![Spacemacs Badge](https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg)](http://spacemacs.org) [![Spacemacs Badge](https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg)](http://spacemacs.org)
[![BCH compliance](https://bettercodehub.com/edge/badge/Phundrak/lzw-assignment?branch=master)](https://bettercodehub.com/)
# LZW Compressing tool # LZW Compressing tool

View File

@ -97,8 +97,8 @@ vuchar pack_16(const vuint16::const_iterator t_input_begin,
vuchar pack(const vuint16 t_input) { vuchar pack(const vuint16 t_input) {
vuchar ret{}; vuchar ret{};
constexpr int max_value = ipow(2, 8); constexpr int max_value = ipow(2, 8);
for(auto it = t_input.begin(); it != t_input.end(); ++it) { for (auto it = t_input.begin(); it != t_input.end(); ++it) {
if(*it >= max_value) { if (*it >= max_value) {
const auto next_vec = const auto next_vec =
pack_n(static_cast<vuint16::const_iterator>(it), t_input.end(), 9); pack_n(static_cast<vuint16::const_iterator>(it), t_input.end(), 9);
ret.insert(ret.end(), next_vec.begin(), next_vec.end()); ret.insert(ret.end(), next_vec.begin(), next_vec.end());

View File

@ -10,12 +10,13 @@
#include <vector> #include <vector>
/// \brief Packs std::uint16_t of n bits into unsigned char /// \brief Packs std::uint16_t of n bits into unsigned char
std::vector<unsigned char> pack_n(const std::vector<std::uint16_t>::const_iterator, std::vector<unsigned char>
const std::vector<std::uint16_t>::const_iterator, pack_n(const std::vector<std::uint16_t>::const_iterator,
int); const std::vector<std::uint16_t>::const_iterator, int);
/// \brief Specialization of \ref pack_n for 16bits /// \brief Specialization of \ref pack_n for 16bits
std::vector<unsigned char> pack_16(const std::vector<std::uint16_t>::const_iterator, std::vector<unsigned char>
const std::vector<std::uint16_t>::const_iterator); pack_16(const std::vector<std::uint16_t>::const_iterator,
const std::vector<std::uint16_t>::const_iterator);
#endif /* LZW_SRC_BITPACK_H_ */ #endif /* LZW_SRC_BITPACK_H_ */