Compact an array of routing keys before using it for bindings.