More efficient bucket resolution
A little bit more general optimization
Merge pull request #951 from basho/feature/gh940-efficient-bucket-resolution

More efficient bucket resolution

Reviewed-by: shino