Skip to content

Commit

Permalink
remove unnecessary if (ptr==NULL) before delete ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
mli committed Jul 21, 2015
1 parent 53f5a9a commit 5cd3d27
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/data/disk_row_iter.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class DiskRowIter: public RowBlockIter<IndexType> {
}
virtual ~DiskRowIter(void) {
iter_.Destroy();
if (fi_ != NULL) delete fi_;
delete fi_;
}
virtual void BeforeFirst(void) {
iter_.BeforeFirst();
Expand Down
2 changes: 1 addition & 1 deletion src/data/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class ThreadedParser : public ParserImpl<IndexType> {
// stop things before base is deleted
iter_.Destroy();
delete base_;
if (tmp_ != NULL) delete tmp_;
delete tmp_;
}
virtual void BeforeFirst() {
iter_.BeforeFirst();
Expand Down
2 changes: 1 addition & 1 deletion src/io/cached_input_split.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CachedInputSplit : public InputSplit {
delete iter_preproc_;
delete fo_;
iter_cached_.Destroy();
if (tmp_chunk_ != NULL) delete tmp_chunk_;
delete tmp_chunk_;
delete base_;
delete fi_;
}
Expand Down
2 changes: 1 addition & 1 deletion src/io/input_split_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void InputSplitBase::BeforeFirst(void) {
}

InputSplitBase::~InputSplitBase(void) {
if (fs_ != NULL) delete fs_;
delete fs_;
// no need to delete filesystem, it was singleton
}

Expand Down
2 changes: 1 addition & 1 deletion src/io/threaded_input_split.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ThreadedInputSplit : public InputSplit {
// destructor
virtual ~ThreadedInputSplit(void) {
iter_.Destroy();
if (tmp_chunk_ != NULL) delete tmp_chunk_;
delete tmp_chunk_;
delete base_;
}
virtual void BeforeFirst() {
Expand Down

0 comments on commit 5cd3d27

Please sign in to comment.