Page MenuHomeDevCentral

Lazy evaluate default values
ClosedPublic

Authored by dereckson on May 30 2020, 22:52.
Tags
None
Referenced Files
F57064295: D2289.diff
Sat, Nov 14, 01:00
F56985878: D2289.id5767.diff
Thu, Nov 12, 11:44
F56985867: D2289.id5767.diff
Thu, Nov 12, 11:43
F56967392: D2289.id5769.diff
Thu, Nov 12, 00:24
F56759995: D2289.id5767.diff
Mon, Nov 9, 02:18
F56654486: D2289.diff
Sun, Nov 8, 00:58
F56525258: D2289.diff
Fri, Nov 6, 20:04
F56416792: D2289.id5769.diff
Thu, Nov 5, 23:49
Subscribers
None

Details

Summary

The unwrap_or_else method allows to pass a closure,
and so allows lazy evaluation of the argument.

Test Plan

println!("Mounting at {}", entry_point);

Diff Detail

Repository
rLF Limiting Factor
Lint
Lint Passed
Unit
No Test Coverage
Branch
fix-unwrap-or
Build Status
Buildable 3558
Build 3807: arc lint + arc unit

Event Timeline

dereckson created this revision.

I'm not sure the performance improvement justify a commit. These kind of optimization can probably be done by the compiler because String::from("/") have no side effect.

This revision is now accepted and ready to land.Sep 24 2020, 20:05
This revision was automatically updated to reflect the committed changes.