Skip to content

Refactor unnecessarily complex assert in AsyncSnapshot constructor #135731

@RandalSchwartz

Description

@RandalSchwartz

: assert(!(data != null && error != null)),

The expression assert(!(data != null && error != null)) can be simplified to assert(data == null || error == null)

It took me about five readings of that to figure out what it meant. deMorgan to the rescue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.good first issueRelatively approachable for first-time contributorsr: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions