Skip to content

refactor: rm redundant internal vars - #1278

Merged
antongolub merged 2 commits into
google:mainfrom
antongolub:rm-redundant-vars
Jul 20, 2025
Merged

refactor: rm redundant internal vars#1278
antongolub merged 2 commits into
google:mainfrom
antongolub:rm-redundant-vars

Conversation

@antongolub

Copy link
Copy Markdown
Collaborator
  • Tests pass
  • Appropriate changes to README are included in PR

@antongolub antongolub added the refactoring Internal code improvements label Jul 20, 2025
@antongolub
antongolub requested a review from Copilot July 20, 2025 07:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the codebase to remove redundant internal variables and simplify code structure while maintaining the same functionality. The changes focus on eliminating unnecessary variable assignments and streamlining conditional logic.

  • Simplified the once utility function implementation using comma operator
  • Removed redundant variable assignments (self variable when this can be used directly)
  • Inverted conditional logic for better readability and reduced nesting
  • Updated size limits to reflect the reduced bundle size from these optimizations

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/util.test.js Added imports and test coverage for identity and once functions
src/util.ts Refactored once function to use comma operator instead of separate statements
src/core.ts Removed redundant self variable assignments and inverted conditional logic
build/util.cjs Compiled output reflecting the once function refactoring
build/core.cjs Compiled output reflecting the core.ts changes
.size-limit.json Updated size limits to reflect reduced bundle size

Comment thread src/util.ts
Comment thread src/core.ts Outdated
@antongolub
antongolub merged commit 97b36cc into google:main Jul 20, 2025
28 checks passed
@antongolub
antongolub deleted the rm-redundant-vars branch July 20, 2025 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Internal code improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants