Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Avoid unnecessary objects #192

Merged
merged 1 commit into from
Aug 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Binding/src/main/scala/com/thoughtworks/binding/Binding.scala
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ object Binding extends MonadicFactory.WithTypeClass[Monad, Binding] {
}
}

private object ReentryDetector extends Binding[Nothing] {
private val ReentryDetector = new Binding[Nothing] {
protected def throwException(): Nothing =
throw new IllegalStateException(
"Must not change an upstream value in a data binding expression that depends on the same upstream value!")
Expand Down Expand Up @@ -618,7 +618,7 @@ object Binding extends MonadicFactory.WithTypeClass[Monad, Binding] {

}

private[binding] object Empty extends BindingSeq[Nothing] {
private[binding] val Empty = new BindingSeq[Nothing] {
@inline
override protected def removePatchedListener(listener: PatchedListener[Nothing]): Unit = {}

Expand Down Expand Up @@ -1474,12 +1474,12 @@ object Binding extends MonadicFactory.WithTypeClass[Monad, Binding] {

}

private[binding] object DummyPatchedListener extends PatchedListener[Any] {
private[binding] val DummyPatchedListener = new PatchedListener[Any] {
@inline
override def patched(event: PatchedEvent[Any]): Unit = {}
}

private[binding] object DummyChangedListener extends ChangedListener[Any] {
private[binding] val DummyChangedListener = new ChangedListener[Any] {
@inline
override def changed(event: ChangedEvent[Any]): Unit = {}
}
Expand Down