remove the if block
This commit is contained in:
parent
cc57656969
commit
80afd9db2e
1 changed files with 9 additions and 22 deletions
|
@ -26,7 +26,6 @@ pub fn deref_finder<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
|
||||||
|
|
||||||
// We are adding current p_ref's projections to our
|
// We are adding current p_ref's projections to our
|
||||||
// temp value, excluding projections we already covered.
|
// temp value, excluding projections we already covered.
|
||||||
if idx == 1 {
|
|
||||||
let deref_place = Place::from(place_local)
|
let deref_place = Place::from(place_local)
|
||||||
.project_deeper(&p_ref.projection[last_len..], tcx);
|
.project_deeper(&p_ref.projection[last_len..], tcx);
|
||||||
patch.add_assign(
|
patch.add_assign(
|
||||||
|
@ -37,18 +36,6 @@ pub fn deref_finder<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
|
||||||
|
|
||||||
place_local = temp;
|
place_local = temp;
|
||||||
last_len = p_ref.projection.len();
|
last_len = p_ref.projection.len();
|
||||||
} else {
|
|
||||||
let deref_place = Place::from(place_local)
|
|
||||||
.project_deeper(&p_ref.projection[last_len..], tcx);
|
|
||||||
patch.add_assign(
|
|
||||||
loc,
|
|
||||||
Place::from(temp),
|
|
||||||
Rvalue::Use(Operand::Move(deref_place)),
|
|
||||||
);
|
|
||||||
|
|
||||||
place_local = temp;
|
|
||||||
last_len = p_ref.projection.len();
|
|
||||||
}
|
|
||||||
|
|
||||||
// We are creating a place by using our temp value's location
|
// We are creating a place by using our temp value's location
|
||||||
// and copying derefed values which we need to create new statement.
|
// and copying derefed values which we need to create new statement.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue