Merge branch 'cleanup' into 'master'

minor cleanup

See merge request redox-os/relibc!1107
This commit is contained in:
Jeremy Soller
2026-03-19 08:26:18 -06:00
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -66,15 +66,14 @@ struct FormatFlags {
/// Formats a monetary value according to the current locale.
fn apply_grouping(int_str: &str, monetary: &LocaleMonetaryInfo) -> String {
let mut grouped = String::with_capacity(int_str.len() * 2);
let mut count = 0;
let mut group_idx = 0;
let current_grouping = &monetary.mon_grouping;
let separator = monetary.mon_thousands_sep;
for c in int_str.chars() {
for (count, c) in int_str.chars().enumerate() {
if count > 0 {
let current_group = current_grouping[group_idx.min(current_grouping.len() - 1)];
if current_group > 0 && count % current_group == 0 {
if current_group > 0 && (count as u8).is_multiple_of(current_group) {
grouped.push_str(separator);
if group_idx + 1 < current_grouping.len() {
group_idx += 1;
@@ -82,7 +81,6 @@ fn apply_grouping(int_str: &str, monetary: &LocaleMonetaryInfo) -> String {
}
}
grouped.push(c);
count += 1;
}
grouped
+1 -1
View File
@@ -1425,7 +1425,7 @@ pub unsafe fn convert_hex(s: *const c_char) -> Option<(c_ulong, isize, bool)> {
unsafe { convert_integer(s.offset(2), 16) }
.map(|(val, idx, overflow)| (val, idx + 2, overflow))
} else {
unsafe { convert_integer(s, 16) }.map(|(val, idx, overflow)| (val, idx, overflow))
unsafe { convert_integer(s, 16) }
}
}