mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Use inclusive range
Co-authored-by: Michael Debertol <michael.debertol@gmail.com>
This commit is contained in:
parent
cebf1f09df
commit
23f655e2a5
1 changed files with 1 additions and 1 deletions
|
@ -102,7 +102,7 @@ pub fn get_groups_gnu(arg_id: Option<u32>) -> IOResult<Vec<gid_t>> {
|
|||
|
||||
fn sort_groups(mut groups: Vec<gid_t>, egid: gid_t) -> Vec<gid_t> {
|
||||
if let Some(index) = groups.iter().position(|&x| x == egid) {
|
||||
groups[..index + 1].rotate_right(1);
|
||||
groups[..=index].rotate_right(1);
|
||||
} else {
|
||||
groups.insert(0, egid);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue