Skip to content

Conversation

@Meet00028
Copy link

Description

This PR uses the already-defined slice reference instead of Array.prototype.slice in the app.listen implementation for consistency and micro-optimization.

Changes

  • Changed Array.prototype.slice.call(arguments) to slice.call(arguments) in lib/application.js

Rationale

  • Improves consistency within the file (uses the cached reference defined at line 33)
  • Avoids repeated long-form prototype access
  • Slight micro-optimization (cached function reference)
  • No behavioral changes
  • All tests continue to pass

Testing

All existing tests pass (1236 passing, 2 pending), including all app.listen() tests.

Closes #6896

Use the already-defined slice reference instead of Array.prototype.slice
for consistency and micro-optimization.

Closes expressjs#6896
@efekrskl
Copy link
Member

Thanks for your PR. However, this is the exact same PR with #6897

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minor Cleanup: Use Cached slice Reference in app.listen Implementation

3 participants