@@ -379,6 +379,7 @@ void ram_integer64_shellsort_asc(ValueT *data, IndexT l, IndexT r)
379379{
380380 ValueT v ;
381381 IndexT i , j , h , lh , t , n = r - l + 1 ;
382+ if (n < 2 ) return ;
382383 for (t = 0 ; shellincs [t ] > n ; t ++ );
383384 for (h = shellincs [t ]; t < SHELLARRAYSIZE ; h = shellincs [++ t ]){
384385 lh = l + h ;
@@ -397,6 +398,7 @@ void ram_integer64_shellsort_desc(ValueT *data, IndexT l, IndexT r)
397398{
398399 ValueT v ;
399400 IndexT i , j , h , lh , t , n = r - l + 1 ;
401+ if (n < 2 ) return ;
400402 for (t = 0 ; shellincs [t ] > n ; t ++ );
401403 for (h = shellincs [t ]; t < SHELLARRAYSIZE ; h = shellincs [++ t ]){
402404 lh = l + h ;
@@ -416,6 +418,7 @@ void ram_integer64_shellsortorder_asc(ValueT *data, IndexT *index, IndexT l, Ind
416418{
417419 ValueT v ;
418420 IndexT vi , i , j , h , lh , t , n = r - l + 1 ;
421+ if (n < 2 ) return ;
419422 for (t = 0 ; shellincs [t ] > n ; t ++ );
420423 for (h = shellincs [t ]; t < SHELLARRAYSIZE ; h = shellincs [++ t ]){
421424 lh = l + h ;
@@ -437,6 +440,7 @@ void ram_integer64_shellsortorder_desc(ValueT *data, IndexT *index, IndexT l, In
437440{
438441 ValueT v ;
439442 IndexT vi , i , j , h , lh , t , n = r - l + 1 ;
443+ if (n < 2 ) return ;
440444 for (t = 0 ; shellincs [t ] > n ; t ++ );
441445 for (h = shellincs [t ]; t < SHELLARRAYSIZE ; h = shellincs [++ t ]){
442446 lh = l + h ;
@@ -459,6 +463,7 @@ void ram_integer64_shellorder_asc(ValueT *data, IndexT *index, IndexT l, IndexT
459463{
460464 ValueT v ;
461465 IndexT vi , i , j , h , lh , t , n = r - l + 1 ;
466+ if (n < 2 ) return ;
462467 for (t = 0 ; shellincs [t ] > n ; t ++ );
463468 for (h = shellincs [t ]; t < SHELLARRAYSIZE ; h = shellincs [++ t ]){
464469 lh = l + h ;
@@ -478,6 +483,7 @@ void ram_integer64_shellorder_desc(ValueT *data, IndexT *index, IndexT l, IndexT
478483{
479484 ValueT v ;
480485 IndexT vi , i , j , h , lh , t , n = r - l + 1 ;
486+ if (n < 2 ) return ;
481487 for (t = 0 ; shellincs [t ] > n ; t ++ );
482488 for (h = shellincs [t ]; t < SHELLARRAYSIZE ; h = shellincs [++ t ]){
483489 lh = l + h ;
0 commit comments