Skip to content

Remove unused dangling identifiers after while -> for loop rewrite  #9

@elliottyoon

Description

@elliottyoon
pub unsafe fn insertion_sort(n: i32, p: *mut i32) {
    let mut i: i32 = 1 as i32; // Remove this.
    for i in 1..n {
        let tmp: i32 = *p.offset(i as isize);
        let mut j: i32 = i;
        while j > 0 as i32 && *p.offset((j - 1 as i32) as isize) > tmp {
            *p.offset(j as isize) = *p.offset((j - 1 as i32) as isize);
            j -= 1;
        }
        *p.offset(j as isize) = tmp;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions