Remove unnecessary copies in dynamic::hash()
Summary: `dynamic::hash()` would copy every key-value pair in the object accumulator hash because of two bugs in the code: 1. The lambda took `auto` instead of `auto const&` 2. The hasher was `hash<pair<dynamic, dynamic>>` not `hash<pair<dynamic const, dynamic>>` meaning a conversion was needed. These bugs together caused 2 copies for each sub-object. Since the copies are recursive, each object got copied 2*depth times. Reviewed By: yfeldblum Differential Revision: D16452213 fbshipit-source-id: 64a55e1640abb022c148183646e9f9720fd8482e
Showing
Please register or sign in to comment