Skip to content

Commit

Permalink
Polish SimpleObservation.openScope()
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye committed May 13, 2023
1 parent cb04fb0 commit 935c415
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,7 @@ public void stop() {

@Override
public Scope openScope() {
Deque<Scope> scopes = enclosingScopes.get(Thread.currentThread());
if (scopes == null) {
scopes = new ArrayDeque<>();
enclosingScopes.put(Thread.currentThread(), scopes);
}
Deque<Scope> scopes = enclosingScopes.computeIfAbsent(Thread.currentThread(), (k) -> new ArrayDeque<>());
Scope currentScope = registry.getCurrentObservationScope();
if (currentScope != null) {
scopes.addFirst(currentScope);
Expand Down

0 comments on commit 935c415

Please sign in to comment.