def _next_index(self, index=None):
        # Optimize the case where we overwrite the most recently added
        # value.
        if index is not None and index == self.next - 1:
            return index
        index = self.next
        self.next += 1
        return index
Compute an optimal index number for storing an element.
dataset/ETHPy150Open MapQuest/mapquest-osm-server/src/python/datastore/lrucache.py/BoundedLRUBuffer._next_index