jcs
/subtext
/amendments
/524
bile: Sync with upstream
jcs made amendment 524 about 1 year ago
--- bile.c Tue Apr 18 23:09:36 2023
+++ bile.c Tue Sep 19 21:02:46 2023
@@ -362,13 +362,13 @@ bile_sorted_ids_by_type(struct bile *bile, const OSTyp
return 0;
}
- for (n = 0; n < count; n++) {
- for (j = 0; j < count - n - 1; j++) {
- if (ids[j] > ids[j + 1]) {
- t = ids[j];
- ids[j] = ids[j + 1];
- ids[j + 1] = t;
- }
+ for (n = 1; n < count; n++) {
+ for (j = n; j > 0; j--) {
+ t = ids[j];
+ if (t > ids[j - 1])
+ break;
+ ids[j] = ids[j - 1];
+ ids[j - 1] = t;
}
}