mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-26 11:22:41 +00:00
wow (#8158)
This commit is contained in:
@@ -42,8 +42,15 @@ public class Utf8Old extends Utf8 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ThreadLocal.withInitial() is not used to make the following code compatible with Android API
|
||||||
|
// level 23.
|
||||||
private static final ThreadLocal<Cache> CACHE =
|
private static final ThreadLocal<Cache> CACHE =
|
||||||
ThreadLocal.withInitial(() -> new Cache());
|
new ThreadLocal<Cache>() {
|
||||||
|
@Override
|
||||||
|
protected Cache initialValue() {
|
||||||
|
return new Cache();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Play some games so that the old encoder doesn't pay twice for computing
|
// Play some games so that the old encoder doesn't pay twice for computing
|
||||||
// the length of the encoded string.
|
// the length of the encoded string.
|
||||||
|
|||||||
Reference in New Issue
Block a user