CLN refactor core indexes
Some refactorings found by Sourcery https://sourcery.ai/

I've removed the ones of the kind
```diff
- if param:
-     var = a
- else:
-     var = b
+ var = a if param else b
```
can you rebase this again to make sure failures are not systemtic The problem is that
```
pytest pandas/tests/reductions/test_reductions.py::TestIndexReductions::test_minmax_period
```
gets to
```python
        if self.hasnans:
            if skipna:
                min_stamp = self[~self._isnan].asi8.min()
            else:
                return self._na_value
        else:
            min_stamp = i8.min()
        try:
            return self._data._box_func(min_stamp)
        except ValueError:
            return self._na_value
```
and throws a ValueError on `min_stamp = self[~self._isnan].asi8.min()`

----

latest commit addresses that can you merge master ping on green @MarcoGorelli if you rebase and fix this up we can get into 1.2 > @MarcoGorelli if you rebase and fix this up we can get into 1.2

sure, have fixed conflicts and responded to review comments can you rebase  thanks @MarcoGorelli 