Skip to content

Update logic to use short-circuit logical operations #25874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kumiDa
Copy link
Contributor

@kumiDa kumiDa commented May 28, 2025

Description

  • Change to preferentially use short-circuit logical operations in trino/core

Release notes

( x ) This is not user-visible or is docs only, and no release notes are required.

@cla-bot cla-bot bot added the cla-signed label May 28, 2025
@kumiDa kumiDa requested review from ebyhr, mosabua and a team May 28, 2025 04:52
@ebyhr ebyhr removed the request for review from a team June 2, 2025 05:32
@@ -63,7 +63,7 @@ public void serialize(LongDecimalWithOverflowAndLongState state, BlockBuilder ou
// high != 0 (countOffset = 2)
// overflow == 0 & count == 1 -> bufferLength = 2
// overflow != 0 || count != 1 -> bufferLength = 4
int bufferLength = countOffset + ((overflow == 0 & count == 1) ? 0 : 2);
Copy link
Member

Choose a reason for hiding this comment

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

nit: this might by purpouse IRC to avoid branching

Copy link
Member

@raunaqmorarka raunaqmorarka left a comment

Choose a reason for hiding this comment

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

I don't think this matters either way, so I would leave it unchanged

Copy link

This pull request has gone a while without any activity. Ask for help on #core-dev on Trino slack.

@github-actions github-actions bot added the stale label Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants