Skip to content

Commit 1787fee

Browse files
author
Philip Guo
committed
linked list hack
1 parent 10e8b2f commit 1787fee

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎v3/js/pytutor.js‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,12 +1751,19 @@ ExecutionVisualizer.prototype.precomputeCurTraceLayouts = function() {
17511751

17521752
if (!isPrimitiveType(child)) {
17531753
var childID = getRefID(child);
1754-
if (structurallyEquivalent(heapObj, curEntry.heap[childID])) {
1755-
updateCurLayout(childID, curRow, newRow);
1756-
}
1757-
else if (myViz.disableHeapNesting) {
1754+
1755+
// comment this out to make "linked lists" that aren't
1756+
// structurally equivalent look good, e.g.,:
1757+
// x = (1, 2, (3, 4, 5, 6, (7, 8, 9, None)))
1758+
//if (structurallyEquivalent(heapObj, curEntry.heap[childID])) {
1759+
// updateCurLayout(childID, curRow, newRow);
1760+
//}
1761+
if (myViz.disableHeapNesting) {
17581762
updateCurLayout(childID, [], []);
17591763
}
1764+
else {
1765+
updateCurLayout(childID, curRow, newRow);
1766+
}
17601767
}
17611768
});
17621769
}

0 commit comments

Comments
 (0)