Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tianmu): revert some compress code issue. (#11) #1037

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion storage/tianmu/compress/suffix_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class SuffixTree : public PPMModel {
// If dlen_=-1, it's assumed that data_ contains only one string.
SuffixTree(const Symb *data, int dlen = -1) {
Init();
if (dlen_ < 0)
if (dlen < 0)
dlen_ = (int)std::strlen((const char *)data) + 1;
else
dlen_ = dlen;
Expand Down
2 changes: 1 addition & 1 deletion storage/tianmu/compress/word_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class WordGraph : public PPMModel {
// CAUTION: the 'data_' array is NOT physically copied, only its pointer.
// So the data_ must not change outside this class during lifetime of this
// object.
WordGraph(const Symb *data_, int dlen_ = -1, bool insatend_ = true);
WordGraph(const Symb *data, int dlen = -1, bool insatend = true);
virtual ~WordGraph() { Clear(); }
bool insatend_; // insert new child at the end of the children list?

Expand Down
12 changes: 6 additions & 6 deletions storage/tianmu/types/rc_num.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ namespace types {

RCNum::RCNum(common::ColumnType attrt) : value_(0), scale_(0), is_double_(false), is_dot_(false), attr_type_(attrt) {}

RCNum::RCNum(int64_t value_, short scale, bool is_double_, common::ColumnType attrt) {
Assign(value_, scale, is_double_, attrt);
RCNum::RCNum(int64_t value, short scale, bool is_double, common::ColumnType attrt) {
Assign(value, scale, is_double, attrt);
}

RCNum::RCNum(double value)
Expand Down Expand Up @@ -207,13 +207,13 @@ RCNum RCNum::ToReal() const {

RCNum RCNum::ToInt() const { return GetIntPart(); }

static char *Text(int64_t value_, char buf[], int scale) {
static char *Text(int64_t value, char buf[], int scale) {
bool sign = true;
if (value_ < 0) {
if (value < 0) {
sign = false;
value_ *= -1;
value *= -1;
}
longlong2str(value_, buf, 10);
longlong2str(value, buf, 10);
int l = (int)std::strlen(buf);
std::memset(buf + l + 1, ' ', 21 - l);
int pos = 21;
Expand Down