Skip to content

Commit b40a79c

Browse files
committed
Minor streamlining of setCurrentValue
1 parent 80ca2ef commit b40a79c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/java/com/fasterxml/jackson/core/base/GeneratorBase.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ public Object getCurrentValue() {
136136

137137
@Override
138138
public void setCurrentValue(Object v) {
139-
_writeContext.setCurrentValue(v);
139+
if (_writeContext != null) {
140+
_writeContext.setCurrentValue(v);
141+
}
140142
}
141143

142144
/*
@@ -291,7 +293,6 @@ public void writeStartObject(Object forValue) throws IOException
291293
if ((_writeContext != null) && (forValue != null)) {
292294
_writeContext.setCurrentValue(forValue);
293295
}
294-
setCurrentValue(forValue);
295296
}
296297

297298
/*

src/main/java/com/fasterxml/jackson/core/json/JsonWriteContext.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ public class JsonWriteContext extends JsonStreamContext
2929

3030
/*
3131
/**********************************************************
32-
/* Simple instance reuse slots; speed up things
33-
/* a bit (10-15%) for docs with lots of small
34-
/* arrays/objects
32+
/* Simple instance reuse slots; speed up things a bit (10-15%)
33+
/* for docs with lots of small arrays/objects
3534
/**********************************************************
3635
*/
3736

0 commit comments

Comments
 (0)