Skip to content
Snippets Groups Projects
Commit a8921c0c authored by vas's avatar vas
Browse files

slightly cleaner slaves2indices

parent ed56499c
No related branches found
No related tags found
2 merge requests!2047RA rework,!1847slightly cleaner slaves2indices
...@@ -221,13 +221,9 @@ window.addSlave = function addSlave(slave) { ...@@ -221,13 +221,9 @@ window.addSlave = function addSlave(slave) {
}; };
window.removeSlave = function removeSlave(index) { window.removeSlave = function removeSlave(index) {
delete State.variables.slaveIndices[State.variables.slaves[index].ID]; const ret = State.variables.slaves.deleteAt(index);
for (var key in State.variables.slaveIndices) { State.variables.slaveIndices = slaves2indices();
if (State.variables.slaveIndices[key] > index) { return ret;
State.variables.slaveIndices[key] -= 1;
}
}
return State.variables.slaves.deleteAt(index);
}; };
window.slaves2indices = function slaves2indices() { window.slaves2indices = function slaves2indices() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment