Avoid extra spread / object copy and use `Object.entries` (#163941)
Avoid extra spread / object copy and use `Object.entries` (#163941)

This lets us avoid copying `attrs` and also skips calling `Object.keys` if `attrs` is undefined

`Object.entries` is also slightly faster in this case
microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode