Skip to content

Fix variable shadowing in nested loops (index idx reused) #204

@phychi

Description

@phychi

Description

The function x2fx.m contains a variable shadowing issue where the loop variable idx is reused in nested loops.

Affected Code Section:

for idx = 1:r          % Outer loop line 184
    ...
    for idx = 1:length(collist)  % Inner loop (overwrites outer `idx`)
        ...
    end
end

Expected Behavior

  • Outer and inner loops should use different index variables.

I don't know if the same name of the inner and outer loop indexes of the programming language code will have an effect, but I recommend changing it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions