Skip to content

Commit

Permalink
wow (google#8158)
Browse files Browse the repository at this point in the history
  • Loading branch information
turbotoribio authored and Jochen Parmentier committed Oct 29, 2024
1 parent 6656de6 commit cdbb999
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion java/src/main/java/com/google/flatbuffers/Utf8Old.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,15 @@ private static class Cache {
}
}

// ThreadLocal.withInitial() is not used to make the following code compatible with Android API
// level 23.
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
// the length of the encoded string.
Expand Down

0 comments on commit cdbb999

Please sign in to comment.