misti
misti copied to clipboard
`PreferSenderFunction`: Highlight `ctx.sender` call instead of `ctx` definition
Current behavior:
[LOW] PreferSenderFunction: Code can be optimized by using `sender()` instead of accessing context
contracts/proof_of_capital.tact:236:13:
235 | receive(msg: TakeWalletAddress) {
> 236 | let ctx: Context = context();
^~~
This is an easy task, let me handle this for you.
Hey @lucifer1017,
Sure, feel free to ask questions if you need any help.
I would save the location of the context variable when it first appears in the dataflow into a new map defined in ContextVariablesState. For example, you may want to create a new map (e.g. contextLocations) that maps the names of local Context variables with their locations in the source code (SrcInfo objects present in the Tact AST).