Skip to content

Commit

Permalink
Fix refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
yishn committed Jan 23, 2020
1 parent 8c2134a commit 1f36afd
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/diagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,8 @@ export function fromTeX(code) {
let from = edge.from
let to = edge.to

let fromIndex = -1
let toIndex = -1

for (let node of nodes) {
if (arrEquals(node.position, from)) fromIndex = i
if (arrEquals(node.position, to)) toIndex = i
}
let fromIndex = nodes.findIndex(node => arrEquals(node.position, from))
let toIndex = nodes.findIndex(node => arrEquals(node.position, to))

if (fromIndex === -1) {
let node = {
Expand Down

0 comments on commit 1f36afd

Please sign in to comment.