Bug fix for empty intervall sorting
authordeba
Wed, 25 Jan 2006 14:58:04 +0000
changeset 1904a64e4735bda6
parent 1903 f3d24016dad5
child 1905 b0b3fa857d72
Bug fix for empty intervall sorting
lemon/radix_sort.h
     1.1 --- a/lemon/radix_sort.h	Wed Jan 25 14:40:26 2006 +0000
     1.2 +++ b/lemon/radix_sort.h	Wed Jan 25 14:58:04 2006 +0000
     1.3 @@ -317,6 +317,7 @@
     1.4    
     1.5    template <typename Value, typename Iterator, typename Functor>
     1.6    void counterSignedSort(Iterator first, Iterator last, Functor functor) {
     1.7 +    if (first == last) return;
     1.8      typedef typename std::iterator_traits<Iterator>::value_type Key;
     1.9      typedef std::allocator<Key> Allocator;
    1.10      Allocator allocator;
    1.11 @@ -355,6 +356,7 @@
    1.12  
    1.13    template <typename Value, typename Iterator, typename Functor>
    1.14    void counterUnsignedSort(Iterator first, Iterator last, Functor functor) {
    1.15 +    if (first == last) return;
    1.16      typedef typename std::iterator_traits<Iterator>::value_type Key;
    1.17      typedef std::allocator<Key> Allocator;
    1.18      Allocator allocator;