Commit 1e96b6c
authored
Correct a misused putIfAbsent call (flutter#109)
There is no need to assign within the callback for a `putIfAbsent`
default. Refactor to the most idiomatic version today which is to use
`??=` (since we don't ever assign a null value so we don't care about
the distinction between a missing key and a key assigned to null) and
return the value directly rather than putting it in the Map and then
pulling it back out.1 parent bd0f77f commit 1e96b6c
1 file changed
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
716 | 716 | | |
717 | 717 | | |
718 | 718 | | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
| 719 | + | |
| 720 | + | |
724 | 721 | | |
725 | 722 | | |
726 | 723 | | |
| |||
0 commit comments