Skip to content

Commit

Permalink
optimize: replace with lambda (apache#2967)
Browse files Browse the repository at this point in the history
  • Loading branch information
heyaping388 authored and l81893521 committed Oct 21, 2020
1 parent 9cfd0d7 commit 5e8a376
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import java.util.HashMap;
import java.util.Map;

import io.seata.common.loader.LoadLevel;

/**
Expand All @@ -28,13 +27,7 @@
@LoadLevel(name = "ThreadLocalContextCore", order = Integer.MIN_VALUE)
public class ThreadLocalContextCore implements ContextCore {

private ThreadLocal<Map<String, String>> threadLocal = new ThreadLocal<Map<String, String>>() {
@Override
protected Map<String, String> initialValue() {
return new HashMap<String, String>();
}

};
private ThreadLocal<Map<String, String>> threadLocal = ThreadLocal.withInitial(() -> new HashMap<>());

@Override
public String put(String key, String value) {
Expand Down

0 comments on commit 5e8a376

Please sign in to comment.