Closed Bug 1683227 Opened 3 years ago Closed 3 years ago

Add a note to Maybe::valueOr() describing its argument is always evaluated

Categories

(Core :: MFBT, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

Details

Attachments

(1 file)

Maybe::valueOr() always evaluates its arguments, but the natural of this method may confuse people to think its argument is only evaluated when Maybe contains no value.

We'd better add a note to warn people not calling expensive function to provide the default value. Emilio had caught this during reviews.

Attachment #9193845 - Attachment description: Bug 1683227 - Add a note to Maybe::valueOr() describing its argument is always evaluated. → Bug 1683227 - Add a note to Maybe::valueOr() about a suboptimal usage.
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/e9c936e74e47
Add a note to Maybe::valueOr() about a suboptimal usage. r=sg DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: