Comment

Comment by quelltext

> and I can't explain exactly how their ordered dicts work

Traditionally you simply use a doubly linked list approach on the entries (each entry maintains two additional references to the previous and next entry) for that like LinkedHashMap: https://docs.oracle.com/javase//8/docs/api/java/util/LinkedH...

https://github.com/openjdk-mirror/jdk7u-jdk/blob/master/src/...

Which is also what Python seems to be doing: https://stackoverflow.com/a/34496644

It's fairly intuitive.

Do their new default (now also ordered?) dics do this differently?

parent quelltext 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton