Skip to content
Snippets Groups Projects
Commit 172933e5 authored by Nicolas Voirol's avatar Nicolas Voirol
Browse files

Accept getOrElseUpdate when obviously fine

parent 6aebd247
No related branches found
No related tags found
1 merge request!88Replace uses of scala.collection.mutable.HashMap#getOrElseUpdate with getOrElse + manual update
...@@ -68,11 +68,7 @@ final class TimerStorage private(val _name: Option[String]) ...@@ -68,11 +68,7 @@ final class TimerStorage private(val _name: Option[String])
def selectDynamic(name: String): TimerStorage = get(name) def selectDynamic(name: String): TimerStorage = get(name)
def get(name: String): TimerStorage = synchronized { def get(name: String): TimerStorage = synchronized {
db.getOrElse(name, { db.getOrElseUpdate(name, new TimerStorage(Some(name)))
val res = new TimerStorage(Some(name))
db(name) = res
res
})
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment