Skip to content

Commit

Permalink
Don't reference possibly computed field twice
Browse files Browse the repository at this point in the history
  • Loading branch information
singpolyma committed Oct 17, 2024
1 parent 5e0f193 commit d68d4fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions HaxeCBridge.hx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class HaxeCBridge {
meta: [{name: "HaxeCBridge.wrapper", params: [], pos: field.pos}],
access: field.access,
pos: field.pos,
kind: FFun({ret: TPath({name: "SizeT", pack: ["cpp"]}), params: [], args: [{name: "outPtr", type: ptrT}], expr: macro { if (outPtr != null) { cpp.Pointer.fromRaw(outPtr).set_ref($i{field.name}); } return $i{field.name}.length; } })
kind: FFun({ret: TPath({name: "SizeT", pack: ["cpp"]}), params: [], args: [{name: "outPtr", type: ptrT}], expr: macro { final x = $i{field.name}; if (outPtr != null) { cpp.Pointer.fromRaw(outPtr).set_ref(x); } return x.length; } })
});
insertTo++;
default:
Expand Down Expand Up @@ -294,7 +294,7 @@ class HaxeCBridge {
meta: [{name: "HaxeCBridge.wrapper", params: [], pos: field.pos}],
access: field.access,
pos: field.pos,
kind: FFun({ret: TPath({name: "SizeT", pack: ["cpp"]}), params: [], args: [{name: "outPtr", type: ptrT}], expr: macro { if (outPtr != null) { cpp.Pointer.fromRaw(outPtr).set_ref($i{field.name}); } return $i{field.name}.length; } })
kind: FFun({ret: TPath({name: "SizeT", pack: ["cpp"]}), params: [], args: [{name: "outPtr", type: ptrT}], expr: macro { final x = $i{field.name}; if (outPtr != null) { cpp.Pointer.fromRaw(outPtr).set_ref(x); } return x.length; } })
});
insertTo++;
default:
Expand Down

0 comments on commit d68d4fd

Please sign in to comment.