Closed artemkorsakov closed 8 months ago
If we look at the following code:
def getOrElseBoolean(config: Map[String, String], key: String, defaultValue: Boolean): Boolean = { if (config.contains(key)) { config(key).toBoolean } else { defaultValue } }
, we can see that the result is true only if the given key exists and its value is true.
true
This can be expressed using code:
config.get(key).exists(_.toBoolean)
What type of PR is this?
What problem(s) does this PR solve?
Issue(s) number:
Description:
If we look at the following code:
, we can see that the result is
true
only if the given key exists and its value istrue
.This can be expressed using code:
How do you solve it?
Special notes for your reviewer, ex. impact of this fix, design document, etc: