No9 / localstorage-down

localstorage implementation of leveldown
MIT License
41 stars 13 forks source link

(#76) - correctly iterate when destroying #77

Closed nolanlawson closed 8 years ago

nolanlawson commented 8 years ago

The previous loop logic was incorrect, because it was destroying the localStorage array as it iterated. The proper way to delete elements in an array by index is to iterate backwards, so you don't destroy the array while you're looping.

The new test fails before the fix but succeeds after.

nolanlawson commented 8 years ago

Gonna self-+1 this since it's important.