Use LinkedList for toBeVisited variable in src/Layout.js file #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I recognized that while porting this code from Java, we used a Javascript array instead of the LinkedList for the
toBeVisited
variable that is defined as a LinkedList here (https://github.com/iVis-at-Bilkent/chilay/blob/605e77732a6f06da2081e2d89a68084c1e508cdb/src/main/java/org/ivis/layout/Layout.java#L566) in original Java code. However, since there is apoll()
operation performed on thetoBeVisited
variable here (https://github.com/iVis-at-Bilkent/chilay/blob/605e77732a6f06da2081e2d89a68084c1e508cdb/src/main/java/org/ivis/layout/Layout.java#L584) using an array must decrease the performance. I think that while porting the code, we used the array there just as a result of a little confusion.This PR updates the code to define and use
toBeVisited
variable as a LinkedList instead of the array. I recognized that in the past a similar fix/update has been done in this commit (cytoscape/cytoscape.js-cose-bilkent@a158455) as well.Important Note
I had issue in running
npm install
. Therefore, I could not test the changes in this PR. It may need to be tested before being merged.