Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add extra logging for play mode and refresh #987

Merged
merged 1 commit into from
Jan 14, 2019

Conversation

citizenmatt
Copy link
Member

Add a little bit of logging around switching between play/pause mode, as well as during refresh.

@citizenmatt citizenmatt added this to the Rider 2018.3.2 milestone Jan 9, 2019
@citizenmatt citizenmatt requested a review from van800 January 9, 2019 16:20
@citizenmatt citizenmatt force-pushed the feature/playmode-logging branch from 00a81da to e0c15c0 Compare January 9, 2019 16:30

syncPlayState();

model.Play.Advise(connectionLifetime, play =>
Copy link
Member

Choose a reason for hiding this comment

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

What is the reason for changing AdviseNotNull to Advise here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because model.Play is an IRdProperty<bool>, so the value can't be null.

public static void AdviseNotNull<T>(this ISink<T> me, Lifetime lifetime, Action<T> handler)
{
  me.Advise(lifetime, (Action<T>) (v =>
  {
    if ((object) v == null)
      return;
    handler(v);
  }));
}

If T is a value type, then it has to have a value, but it's still cast to object (and boxed) to compare against null.

Perhaps @korifey can confirm that this change is ok?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for clarification.

Copy link

Choose a reason for hiding this comment

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

Approved. Anyway, I guess we should add where clause to this method to suppress boxing.

@citizenmatt citizenmatt merged commit 55c2547 into 183 Jan 14, 2019
@citizenmatt citizenmatt deleted the feature/playmode-logging branch January 14, 2019 11:58
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants