[Cuis-dev] Removing unused temps from inside blocks

Eric Brandwein brandweineric at gmail.com
Wed Dec 11 21:23:38 PST 2019


Hi all,

Currently, when you save a method with an unused temporary variable
declared, it prompts you to decide if you want to remove it or not. If you
click yes, it removes the declaration, but only if it's declared in the
method scope, and not if it is declared inside a block.

To reproduce, just create a method with an unused temporary variable
declared inside a block, save it, and click 'Yes' on the popup that appears.

This is because the Parser only looks for the variable in the temps
declared in the method scope. Here's a ChangeSet that fixes it making the
Parser look inside blocks too, taking advantage of the fact that the
Encoder has already found the positions for each variable.

Cheers,
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191212/4f3f8ba0/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3960-RemoveUnusedTempInsideBlock-EricBrandwein-2019Dec09-17h42m-EB.1.cs.st
Type: application/vnd.sailingtracker.track
Size: 1188 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191212/4f3f8ba0/attachment.bin>


More information about the Cuis-dev mailing list