Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion client/src/com/aerospike/client/Value.java
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@ public long toLong() {
* String value.
*/
public static final class StringValue extends Value {
private volatile LuaValue cachedLuaValue;

private final String value;

public StringValue(String value) {
Expand Down Expand Up @@ -743,7 +745,12 @@ public Object getObject() {

@Override
public LuaValue getLuaValue(LuaInstance instance) {
return LuaString.valueOf(value);
LuaValue cached = cachedLuaValue;
if (cached == null) {
cached = LuaString.valueOf(value);
cachedLuaValue = cached;
}
return cached;
}

@Override
Expand Down