end.c bit - unnecessary 'else'
This commit is contained in:
@@ -992,7 +992,8 @@ get_valuables(struct obj *list) /* inventory or container contents */
|
|||||||
* as easily use qsort, but we don't care about efficiency here.
|
* as easily use qsort, but we don't care about efficiency here.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
sort_valuables(struct valuable_data list[],
|
sort_valuables(
|
||||||
|
struct valuable_data list[],
|
||||||
int size) /* max value is less than 20 */
|
int size) /* max value is less than 20 */
|
||||||
{
|
{
|
||||||
register int i, j;
|
register int i, j;
|
||||||
@@ -1003,10 +1004,9 @@ sort_valuables(struct valuable_data list[],
|
|||||||
if (list[i].count == 0)
|
if (list[i].count == 0)
|
||||||
continue; /* empty slot */
|
continue; /* empty slot */
|
||||||
ltmp = list[i]; /* structure copy */
|
ltmp = list[i]; /* structure copy */
|
||||||
for (j = i; j > 0; --j)
|
for (j = i; j > 0; --j) {
|
||||||
if (list[j - 1].count >= ltmp.count)
|
if (list[j - 1].count >= ltmp.count)
|
||||||
break;
|
break;
|
||||||
else {
|
|
||||||
list[j] = list[j - 1];
|
list[j] = list[j - 1];
|
||||||
}
|
}
|
||||||
list[j] = ltmp;
|
list[j] = ltmp;
|
||||||
|
|||||||
Reference in New Issue
Block a user