Skip to content

Conversation

@Hixie
Copy link
Contributor

@Hixie Hixie commented Jun 27, 2017

No description provided.

@Hixie
Copy link
Contributor Author

Hixie commented Jun 27, 2017

cc @cbracken for review

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

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

Still digging around the codebase to better understand context, but sending off first round of nitpicks.

LGTM for the change in general. Just a few nitpicks.

Copy link
Member

@cbracken cbracken Jun 27, 2017

Choose a reason for hiding this comment

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

Just ${keepAlive ? "keepAlive; " : ""}? Also, leading space that shouldn't be there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nothing prevents it from being false, and I wouldn't want the toString to crash if it was false (which it would if I didn't do == true).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a test to verify that nobody regresses this

Copy link
Member

Choose a reason for hiding this comment

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

Shorter: .forEach(_childManager.removeChild), or go for a local and a for-loop to avoid the forEach with a function literal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

Why the .toList() here? Can removeChild indirectly modify _keepAliveBucket?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, removeChild very much modifies _keepAliveBucket, that's the purpose of the call in fact. :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a comment to that effect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and an assert!

Copy link
Member

Choose a reason for hiding this comment

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

Is it worth adding the caveat that addRepaintBoundaries must not be null here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do that on the constructors, by convention.

Copy link
Member

Choose a reason for hiding this comment

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

Assert that addRepaintBoundaries is non-null.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

Copy link
Member

Choose a reason for hiding this comment

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

Since this is no longer a closure, you could kill off bool result and return the literals instead.

I suspect I've got some sort of obsession relating to shortening lines code though -- probably dates back to those one-liners in the back of Compute! magazine in the 80s.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

2017

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@Hixie
Copy link
Contributor Author

Hixie commented Jun 28, 2017

Updated per comments. Will land on green unless I hear otherwise.

@cbracken
Copy link
Member

lgtm

@Hixie Hixie merged commit 5279563 into flutter:master Jun 28, 2017
@Hixie Hixie deleted the keep-alive branch June 28, 2017 21:06
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jul 1, 2017
@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.

3 participants