protocol / launchpad

The curriculum for the Launchpad program
Apache License 2.0
38 stars 88 forks source link

Fix IPLD Vector implementation example #352

Closed bajtos closed 1 year ago

bajtos commented 1 year ago

The text says:

But note that we can’t pass the original index value down to that child because it only knows about the graph below it, so we essentially remove part of the index value that is not relevant to the child and pass that on.

The code calls getElementAt(index), contradicting the explanation.

In this pull request, I changed to code to call getElementAt(newIndex) instead.

Before my change, the variable newIndex was set but never read.

/cc @rvagg: Can you PTAL? I saw you had presented this code snippet in the Youtube video ResNetLab: Elective Course Module - InterPlanetary Linked Data (IPLD).