Tidier method of testing whether indexing is allowed.