See meta #2002650: [meta] improve maintainability by removing unused local variables
Looks good. Nothing tricky and the testbot is happy.
Unless this was done many thousands of times in the critical path (and possibly even then) I don't think it will show a measurable performance difference, however it's good cleanup and well spotted! Committed/pushed to 8.x.
Automatically closed -- issue fixed for 2 weeks with no activity.
Drupal is a registered trademark of Dries Buytaert.