Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avoid promoting an unsigned short to an int before comparing it
`self->mm` is an unsigned short. `self->kk` is an unsigned short. `self->mm - self->kk` is promoted to an int. `i` is a size_t (a long unsigned int). `i < self->mm - self->kk` is `(long unsigned int) < (int)` is a compiler warning about comparing types with different signedness. `self->mm - self->kk` is never a negative overflow because `self->kk > self->mm` is not allowed by the constructor. Thus `self->mm - self->kk` is 0 at the smallest. long unsigned int is larger than unsigned short so neither `(size_t)self->mm` nor `(size_t)self->kk` is a positive overflow. Since there is no positive overflow on cast and there is no chance of negative values `(size_t)self->mm - (size_t)self->kk` has the same value as `self->mm - self->kk`.
- Loading branch information