Skip to content

Conversation

@radarhere
Copy link
Member

@radarhere radarhere commented Mar 27, 2021

build_distance_tables only ever returns 1 -

static int
build_distance_tables(
uint32_t *avgDist, uint32_t **avgDistSortKey, Pixel *p, uint32_t nEntries) {
uint32_t i, j;
for (i = 0; i < nEntries; i++) {
avgDist[i * nEntries + i] = 0;
avgDistSortKey[i * nEntries + i] = &(avgDist[i * nEntries + i]);
for (j = 0; j < i; j++) {
avgDist[j * nEntries + i] = avgDist[i * nEntries + j] =
_DISTSQR(p + i, p + j);
avgDistSortKey[j * nEntries + i] = &(avgDist[j * nEntries + i]);
avgDistSortKey[i * nEntries + j] = &(avgDist[i * nEntries + j]);
}
}
for (i = 0; i < nEntries; i++) {
qsort(
avgDistSortKey + i * nEntries,
nEntries,
sizeof(uint32_t *),
_sort_ulong_ptr_keys);
}
return 1;
}

So this PR removes the return value.

@radarhere radarhere changed the title Removed unreachable code Removed build_distance_tables return value Mar 27, 2021
@hugovk hugovk merged commit 9431d94 into python-pillow:master Mar 27, 2021
@radarhere radarhere deleted the unreachable branch March 28, 2021 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants