Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 20, 2022. It is now read-only.

Conversation

@ianoc
Copy link
Collaborator

@ianoc ianoc commented Dec 3, 2014

No description provided.

Copy link
Collaborator

Choose a reason for hiding this comment

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

actually just below, you evaluate default more than once.

Might be better to do:

if (v == null) {
  val vToPut = default
  map.putIfAbsent(k, vToPut) match {
    case null => vToPut
    case vExists => vExists
  }
}

In this case it can still be evaluated when it is not needed (due to a concurrent put beating it in), but there are no loops and no two evals.

@johnynek
Copy link
Collaborator

johnynek commented Dec 3, 2014

looks fine (except noticed a minor issue that might be nice to fix).

ianoc added a commit that referenced this pull request Jan 23, 2015
Make some classes public so we can make custom platforms
@ianoc ianoc merged commit e7b9380 into develop Jan 23, 2015
@ianoc ianoc deleted the unPrivateSomeClasses branch January 23, 2015 19:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants