Skip to content

Infinite loop when inserting Array into RBTree #25

@nk327

Description

@nk327

Somewhat of an edge case, but can lead to a bad state in applications using this library -- hanging and high CPU usage.

Repro case:

let rbtree = new RBTree(function(a, b) { return a.value - b.value; });
rbtree.insert( [ ] );
rbtree.insert( [ ] );  // <-- infinite loop

This works ok with BinTree though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions