make it clearer what the result of wrapArrayIndices will be
This commit is contained in:
@ -77,8 +77,6 @@ static void freeArray(db_field_log *pfl)
|
||||
static long wrapArrayIndices(long *start, const long increment, long *end,
|
||||
const long no_elements)
|
||||
{
|
||||
long len = 0;
|
||||
|
||||
if (*start < 0) *start = no_elements + *start;
|
||||
if (*start < 0) *start = 0;
|
||||
if (*start > no_elements) *start = no_elements;
|
||||
@ -87,8 +85,10 @@ static long wrapArrayIndices(long *start, const long increment, long *end,
|
||||
if (*end < 0) *end = 0;
|
||||
if (*end >= no_elements) *end = no_elements - 1;
|
||||
|
||||
if (*end - *start >= 0) len = 1 + (*end - *start) / increment;
|
||||
return len;
|
||||
if (*end - *start >= 0)
|
||||
return 1 + (*end - *start) / increment;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static db_field_log* filter(void* pvt, dbChannel *chan, db_field_log *pfl)
|
||||
|
Reference in New Issue
Block a user