[Lemon-commits] [lemon_svn] deba: r2479 - hugo/trunk/lemon

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:52:59 CET 2006


Author: deba
Date: Wed Jan 25 15:58:04 2006
New Revision: 2479

Modified:
   hugo/trunk/lemon/radix_sort.h

Log:
Bug fix for empty intervall sorting



Modified: hugo/trunk/lemon/radix_sort.h
==============================================================================
--- hugo/trunk/lemon/radix_sort.h	(original)
+++ hugo/trunk/lemon/radix_sort.h	Wed Jan 25 15:58:04 2006
@@ -317,6 +317,7 @@
   
   template <typename Value, typename Iterator, typename Functor>
   void counterSignedSort(Iterator first, Iterator last, Functor functor) {
+    if (first == last) return;
     typedef typename std::iterator_traits<Iterator>::value_type Key;
     typedef std::allocator<Key> Allocator;
     Allocator allocator;
@@ -355,6 +356,7 @@
 
   template <typename Value, typename Iterator, typename Functor>
   void counterUnsignedSort(Iterator first, Iterator last, Functor functor) {
+    if (first == last) return;
     typedef typename std::iterator_traits<Iterator>::value_type Key;
     typedef std::allocator<Key> Allocator;
     Allocator allocator;



More information about the Lemon-commits mailing list