Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Address comment from hvanhovell
This addresses the comments for #23398
  • Loading branch information
jamisonbennett committed Dec 31, 2018
commit d89cfd9956f7205ed2b2d1b552cca43b2471bfcb
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ class SimpleFunctionRegistry extends FunctionRegistry with Logging {
info: ExpressionInfo,
builder: FunctionBuilder): Unit = synchronized {
val normalizedName = normalizeFuncName(name)
if (functionBuilders.put(normalizedName, (info, builder)).isDefined) {
logWarning(s"The function $normalizedName replaced a previously registered function.")
val newFunction = (info, builder)
functionBuilders.put(normalizedName, newFunction) match {
case Some(previousFunction) if previousFunction != newFunction =>
logWarning(s"The function $normalizedName replaced a previously registered function.")
case _ => Unit
Copy link
Member

Choose a reason for hiding this comment

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

This is returning Unit type object. This can be just removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made a change here which I think was what you were recommending. I didn't want to remove the case _ => otherwise I think it may result in a non-exhaustive match exception. If you wanted me to remove the entire match statement, just let me know.

}
}

Expand Down