Closed Bug 1603110 Opened 6 years ago Closed 1 year ago

Clarify how to convert the result of integral expressions to bool

Categories

(Core :: DOM: File, task, P3)

task

Tracking

()

RESOLVED INVALID

People

(Reporter: sg, Unassigned)

References

(Blocks 1 open bug)

Details

In https://phabricator.services.mozilla.com/D55469#inline-343915, the question came up whether to use static_cast<bool> or a comparison against 0 to convert the result of integral expression to bool, in that case:

static_cast<bool>(mInitializationAttempts & initialization);

vs.

mInitializationAttempts & initialization != 0

This should be clarified in the coding style, with case distinctions for similar cases if necessary.

Priority: -- → P3
Severity: normal → S3

I think the team-specific coding style guide is moot now.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.