Skip to content

Performance stages with diffrent lane id #20

@santimc

Description

@santimc

in stage.js there the following code inside the update method.

            if (!(laneName in this.map_)) {
                this.map_[laneName] = {};
                this.laneID_Map[laneName] = Object.keys(this.laneID_Map).length;

                // レーンが増えたため,ID を振り直す
                let i = 0;
                for (let key in Object.keys(this.laneID_Map).sort()) {
                    this.laneID_Map[key] = i;
                    i++;
                }

Why wouldn't suffice just assigning the new laneName to the last number as done in

this.laneID_Map[laneName] = Object.keys(this.laneID_Map).length;

I don't know why would be necessary to reassign the whole laneID_Map object when the value given by the .length it's fine.
I notice this because for coloring reasons it's nice to assign different lane ids.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions