Short answer: No
But your implementation is simple, elegant and easy to read, so it should be handled that way