java: implement optimisation in UnoRuntime#setCurrentContext
which is now available since we started requiring Java 1.5 Change-Id: I9847b89af7f487be7812a5717716900e9a517381
This commit is contained in:
@@ -382,8 +382,11 @@ public class UnoRuntime {
|
||||
* previously set context will be removed
|
||||
*/
|
||||
public static void setCurrentContext(XCurrentContext context) {
|
||||
// optimize this by using Java 1.5 ThreadLocal.remove if context == null
|
||||
currentContext.set(context);
|
||||
if (context == null) {
|
||||
currentContext.remove();
|
||||
} else {
|
||||
currentContext.set(context);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user