@samitouri / QOS-React-2 / commits / 1f7cd2ff21

[hir] Remove unnecessary null check

Sathya Gunasekaran committed Feb 7, 2023 at 15:08 UTC 1f7cd2ff21f82443e69b7445a542217efeec2c63
1 file changed +4 -7
compiler/forget/src/SSA/EnterSSA.ts
+4 -7
@@ -202,13 +202,10 @@ export default function enterSSA(func: HIRFunction) {
202 for (const instr of block.instructions) {
203 mapInstructionOperands(instr, (place) => builder.getPlace(place));
204
205 - if (instr.lvalue != null) {
206 - const oldPlace = instr.lvalue.place;
207 - let newPlace: Place;
208 - newPlace = builder.definePlace(oldPlace);
209 - instr.lvalue.kind = InstructionKind.Const;
210 - instr.lvalue.place = newPlace;
211 - }
205 + const oldPlace = instr.lvalue.place;
206 + const newPlace = builder.definePlace(oldPlace);
207 + instr.lvalue.kind = InstructionKind.Const;
208 + instr.lvalue.place = newPlace;
209 }
210
211 mapTerminalOperands(block.terminal, (place) => builder.getPlace(place));