Somewhat faster because we avoid a strlen() call
This was more subtle than I had initially understood