Skip to content

Commit 2a9b2fb

Browse files
committed
Remove wrong description for GenericVector::set_compare_callback and simplify code
Signed-off-by: Stefan Weil <[email protected]>
1 parent dff33d6 commit 2a9b2fb

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

src/ccutil/genericvector.h

+6-17
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,15 @@ class GenericVector {
140140

141141
// Add a callback to be called to delete the elements when the array took
142142
// their ownership.
143-
void set_clear_callback(TessCallback1<T>* cb);
143+
void set_clear_callback(TessCallback1<T>* cb) {
144+
clear_cb_ = cb;
145+
}
144146

145147
// Add a callback to be called to compare the elements when needed (contains,
146148
// get_id, ...)
147-
void set_compare_callback(TessResultCallback2<bool, T const&, T const&>* cb);
149+
void set_compare_callback(TessResultCallback2<bool, T const&, T const&>* cb) {
150+
compare_cb_ = cb;
151+
}
148152

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

904-
// Add a callback to be called to delete the elements when the array took
905-
// their ownership.
906-
template <typename T>
907-
void GenericVector<T>::set_clear_callback(TessCallback1<T>* cb) {
908-
clear_cb_ = cb;
909-
}
910-
911-
// Add a callback to be called to delete the elements when the array took
912-
// their ownership.
913-
template <typename T>
914-
void GenericVector<T>::set_compare_callback(
915-
TessResultCallback2<bool, T const&, T const&>* cb) {
916-
compare_cb_ = cb;
917-
}
918-
919908
// Clear the array, calling the callback function if any.
920909
template <typename T>
921910
void GenericVector<T>::clear() {

0 commit comments

Comments
 (0)