Though not strictly necessary, I think this would read better as return index == 0, as this indicates that other parameters are ok to be null.