Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed build_distance_tables return value #5363

Merged
merged 1 commit into from Mar 27, 2021

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
51 of 53 checks passed
@radarhere radarhere deleted the unreachable branch Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants