Skip to content

cleanup: Combine duplicated code in Client#query and avoid unneeded early non-const declarations#3674

Merged
charmander merged 1 commit into
brianc:masterfrom
charmander:client-query-cleanup
May 14, 2026
Merged

cleanup: Combine duplicated code in Client#query and avoid unneeded early non-const declarations#3674
charmander merged 1 commit into
brianc:masterfrom
charmander:client-query-cleanup

Conversation

@charmander
Copy link
Copy Markdown
Collaborator

No behaviour change except for the negligible one of reading the query_timeout property before submit.

… early non-const declarations

No behaviour change except for the negligible one of reading the `query_timeout` property before `submit`.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors Client#query to deduplicate the readTimeout assignment across the two config branches and switches early-declared let variables to const declarations at their point of use. No behavioral change other than query_timeout now being read unconditionally (including for submittable query objects, which was previously also the case via the other branch).

Changes:

  • Collapse the null/undefined check into config == null.
  • Hoist the readTimeout resolution out of both branches into a single const.
  • Convert queryCallback and readTimeoutTimer from outer lets to inner consts within the if (readTimeout) block.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@charmander charmander merged commit 2095247 into brianc:master May 14, 2026
7 checks passed
@charmander charmander deleted the client-query-cleanup branch May 14, 2026 03:51
charmander added a commit that referenced this pull request May 14, 2026
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.

2 participants