diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2011-11-12 17:04:22 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2011-11-12 17:04:22 +0400 |
commit | 3d70b2e1a5d66a6387b3b4fd023fc3bed2bb28a8 (patch) | |
tree | 190e42b3561f56207082a42d2fc28dd964e61154 /mert/FeatureStats.cpp | |
parent | eecfb171da01a090aed40317ebd8dcebdee9e57c (diff) |
Small change: modify initialization of the Data class.
Diffstat (limited to 'mert/FeatureStats.cpp')
-rw-r--r-- | mert/FeatureStats.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mert/FeatureStats.cpp b/mert/FeatureStats.cpp index 65c25abb1..7f6f66d14 100644 --- a/mert/FeatureStats.cpp +++ b/mert/FeatureStats.cpp @@ -100,8 +100,10 @@ FeatureStats::FeatureStats(std::string &theString) FeatureStats::~FeatureStats() { - if (array_) + if (array_) { delete [] array_; + array_ = NULL; + } } void FeatureStats::Copy(const FeatureStats &stats) @@ -127,11 +129,11 @@ FeatureStats& FeatureStats::operator=(const FeatureStats &stats) void FeatureStats::expand() { - available_*=2; + available_ *= 2; featstats_t t_ = new FeatureStatsType[available_]; memcpy(t_, array_, GetArraySizeWithBytes()); delete [] array_; - array_=t_; + array_ = t_; } void FeatureStats::add(FeatureStatsType v) |