Eliminate extra variable and avoid changing the contents of a string Minor refactoring of commit fa0af103