MANT: rename variable to avoid shadowing

The variable `obj` in `prepare_index` is shadowed in an inner scope within
the function. Renamed the inner scope variable to `tmp_obj` to avoid
confusion.