bluss / permutohedron

https://docs.rs/permutohedron/
Apache License 2.0
38 stars 5 forks source link

Allow terminating heap_recursive early #4

Closed nagisa closed 7 years ago

nagisa commented 8 years ago

Currently there’s no way to terminate heap_recursive early from the callback. Returning a bool from the closure could be an easy way to do it.

bluss commented 8 years ago

The API is a bit all over the place, but Heap is a lazy iterator that can be stepped as far as you want. I guess it has that weird check that the input array/slice is short enough though, that could be changed.

bluss commented 7 years ago

Using the funky ControlFlow thing from here https://docs.rs/petgraph/0.3.2/petgraph/visit/trait.ControlFlow.html makes it Zero CostTM

bluss commented 7 years ago

Fixed