Commit Graph

2 Commits

Author SHA1 Message Date
Anders Kaseorg 23a5cf41dc fold_dict: Reimplement FoldDict using Map.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-01-31 12:15:55 -08:00
Steve Howell ee3e488e02 js: Extract FoldDict class.
We have ~5 years of proof that we'll probably never
extend Dict with more options.

Breaking the classes into makes both a little faster
(no options to check), and we remove some options
in FoldDict that are never used (from/from_array).

A possible next step is to fine-tune the Dict to use
Map internally.

Note that the TypeScript types for FoldDict are now
more specific (requiring string keys).  Of course,
this isn't really enforced until we convert other
modules to TS.
2020-01-03 17:19:50 -08:00