Skip to content

Conversation

@Hixie
Copy link
Contributor

@Hixie Hixie commented Jul 20, 2017

No description provided.

switch (_textPainter.text.compareTo(value)) {
case RenderComparison.identical:
case RenderComparison.metadata:
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a return here but a break below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accident of how i wrote the code, though i can justify it post-hoc: the "return" is an early return (nothing changed, bail out), whereas the other two branches are actually doing something. If we ever add something after the switch, I'd expect the identical/metadata cases to do nothing, but the other cases to do it.

@HansMuller
Copy link
Contributor

LGTM. Nice use of enum.index.

@Hixie Hixie merged commit 194bf41 into flutter:master Jul 20, 2017
@Hixie Hixie deleted the faster-text branch July 20, 2017 00:53
/// For example, [layout] (index 3) implies [paint] (2).
enum RenderComparison {
/// The two objects are identical (meaning deeply equal, not necessarily
/// [identical]).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops. I guess I want [dart:io.identical]. (cc @jcollins-g)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully fixed in #11330

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants