Double-horizon limit, AdS geometry and entropy function