keriwarr / orangejoos

JOOS1W Compiler, written in Crystal
0 stars 1 forks source link

lib: fix ordered_hash re-inserts and add testing #82

Closed lgo closed 6 years ago

lgo commented 6 years ago

Even though the changes aren't used by anything, this was from intermediary work for multiple localvars so I thought it might be useful to keep around.


Previously, if a value was re-inserted into OrderedHash it would duplicate the value in the ordering list. In addition to fixing that, there is now an exposed way to iterate through the ordering.

Tests are also added to test this functionality correctly.

keriwarr commented 6 years ago

oh wups I hadn't even noticed that you implemented an ordered hash in lib/ lol