Skip to content

Commit

Permalink
Remove wrong description for GenericVector::set_compare_callback and …
Browse files Browse the repository at this point in the history
…simplify code

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Jun 22, 2019
1 parent dff33d6 commit 2a9b2fb
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions src/ccutil/genericvector.h
Expand Up @@ -140,11 +140,15 @@ class GenericVector {

// Add a callback to be called to delete the elements when the array took
// their ownership.
void set_clear_callback(TessCallback1<T>* cb);
void set_clear_callback(TessCallback1<T>* cb) {
clear_cb_ = cb;
}

// Add a callback to be called to compare the elements when needed (contains,
// get_id, ...)
void set_compare_callback(TessResultCallback2<bool, T const&, T const&>* cb);
void set_compare_callback(TessResultCallback2<bool, T const&, T const&>* cb) {
compare_cb_ = cb;
}

// Clear the array, calling the clear callback function if any.
// All the owned callbacks are also deleted.
Expand Down Expand Up @@ -901,21 +905,6 @@ GenericVector<T>& GenericVector<T>::operator=(const GenericVector& other) {
return *this;
}

// Add a callback to be called to delete the elements when the array took
// their ownership.
template <typename T>
void GenericVector<T>::set_clear_callback(TessCallback1<T>* cb) {
clear_cb_ = cb;
}

// Add a callback to be called to delete the elements when the array took
// their ownership.
template <typename T>
void GenericVector<T>::set_compare_callback(
TessResultCallback2<bool, T const&, T const&>* cb) {
compare_cb_ = cb;
}

// Clear the array, calling the callback function if any.
template <typename T>
void GenericVector<T>::clear() {
Expand Down

0 comments on commit 2a9b2fb

Please sign in to comment.