constants.rb
960 Bytes
-
Reduced merges, do them in place, and reduce allocations. · c9385b9b
Primarily, we wanted to reduce the one-thing-per-merge calls, but also, we want to reduce allocations overall, both from merge calls which will duplicate the source hash and from string constants sprinkled throughout. Seemingly, defining a constant-style word list is not the ticket. For whatever reason, Ruby can't seem to figure out the list doesn't change, and presumably is splating out all of the words and allocating them as if they were declared right there. Wahhhh. Now we're using a straight up one-for-one constant definition of each string, in a big constants file, where we freeze the strings on the spot. We then reference each constant directly at the callsite, which was the original style and, ultimately, is the best for readability.
Toby Lawrence committed