Skip to content

Conversation

akarnokd
Copy link
Collaborator

  • Add missing _ to private fields
  • Rename internal fields to start with a capital letter
  • Remove type arguments inferable from context
  • Remove unnecessary this. and base. prefixes
  • Remove unnecessary namespace prefixes
  • Remove unused imports
  • Confine certain imports to a narrower #if <label> cases
  • Use IdentitySink with Amb and AmbMany
  • Use object instead of Object
  • Use string instead of String
  • Use decimal instead of Decimal
  • Use int instead of Int32
  • Use long instead of Int64
  • Move the common Action _onCompleted field of ActionPlan<...> into the abstract base class ActionPlan

@@ -12,7 +12,7 @@ namespace System.Reactive.Concurrency
/// <seealso cref="Scheduler.CurrentThread">Singleton instance of this type exposed through this static property.</seealso>
public sealed class CurrentThreadScheduler : LocalScheduler
{
private static readonly Lazy<CurrentThreadScheduler> s_instance = new Lazy<CurrentThreadScheduler>(() => new CurrentThreadScheduler());
private static readonly Lazy<CurrentThreadScheduler> _staticInstance = new Lazy<CurrentThreadScheduler>(() => new CurrentThreadScheduler());
Copy link
Contributor

Choose a reason for hiding this comment

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

When I understand the .editorconfig right, than static readonly fields should be in PascalCase. Although it does not state if this is the case independently of the accessibility modifiers. @onovotny used PascalCase in #720.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is a property with name Instance already.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

See L24:

public static CurrentThreadScheduler Instance => _staticInstance.Value;

Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I also prefer to start private fields with an underscore else you have to become creative for backing fields. Like LazyInstance for example.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can always bring s_ back for static instance fields, but I thought that was nasty.

@danielcweber
Copy link
Collaborator

@akarnokd Sorry, I attempted to fix the conflicts and missed out on scheduler vs. Scheduler.

@danielcweber danielcweber merged commit f650dde into dotnet:master Jul 2, 2018
@akarnokd akarnokd deleted the CleanupSystemReactive branch July 2, 2018 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants