small refactor to canonicalize_indexer
Merge pull request #281 from shoyer/small-indexing-tweak

small refactor to canonicalize_indexer