convert ***sort builtins to use inout instead of references
Summary:
As title.
The tedious bit here is updating the logic to
1. use Variant& instead of VRefParam (i.e. use new inout native convention)
2. still handle references correctly, if passed-in variant happens to contain a reference.
For arrays code paths using `container.toCell()` achieves both - Cell is an alias for TypedValue, and Variant::toCell() unwraps references.
For collections code paths no changes are needed - the code is already references-oblivious (both Variant::isObject() and Variant::getObjectData() unwrap references).
I'm not sure, what was the initial purpose of extra logic in usort(), but I don't think it serves any purpose now. Simplify it to be more similar with php_sort() and friends.
Most of sort functions are already typed as inout in hphp/hack/hhi/container_functions.hhi. Update hhi for natsort() and natcasesort() to use inout as well.
Reviewed By: billf
Differential Revision:
D17552549
fbshipit-source-id:
2c20a23128110decd6377471cdbcdbc13a2c7c0a