Skip to content

STYLE: Replace |= true with = true in SampleGradients, in Optimizers - #1501

Merged
N-Dekker merged 1 commit into
mainfrom
Replce-bitwise-or-in-Optimizers-SampleGradients
Nov 25, 2026
Merged

N-Dekker merged 1 commit into
mainfrom
Replce-bitwise-or-in-Optimizers-SampleGradients

Conversation

@N-Dekker

Copy link
Copy Markdown
Member

Just for the sake of simplicity. stochasticgradients |= true is equivalent to stochasticgradients = true anyway.

Just for the sake of simplicity. `stochasticgradients |= true` is equivalent to `stochasticgradients = true` anyway.
{
/** At least one of the metric has a random sampler. */
stochasticgradients |= true;
stochasticgradients = true;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@stefanklein Just a funny cosmetic thing here! Why would you do |= true on a bool variable, when you can simply do = true? At least it looks like it was you, with commit 93bd2b2 (back in 2008)!

@stefanklein

stefanklein commented Nov 25, 2026 via email

Copy link
Copy Markdown
Member

@N-Dekker
N-Dekker merged commit b399e1b into main Nov 25, 2026
8 checks passed
@N-Dekker
N-Dekker deleted the Replce-bitwise-or-in-Optimizers-SampleGradients branch November 25, 2026 17:04
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