Skip to content

Commit

Permalink
optimize codeSize
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed May 27, 2023
1 parent 1274ebb commit a201953
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
14 changes: 5 additions & 9 deletions core/src/main/java/com/alibaba/fastjson2/JSONWriter.java
Expand Up @@ -230,15 +230,11 @@ public final String setPath(int index, Object object) {
}

public final void popPath(Object object) {
if (this.path == null) {
return;
}

if ((context.features & Feature.ReferenceDetection.mask) == 0) {
return;
}

if (object == Collections.EMPTY_LIST || object == Collections.EMPTY_SET) {
if (this.path == null
|| (context.features & Feature.ReferenceDetection.mask) == 0
|| object == Collections.EMPTY_LIST
|| object == Collections.EMPTY_SET
) {
return;
}

Expand Down
Expand Up @@ -1155,7 +1155,8 @@ private static boolean merge(
final SymbolTable symbolTable,
final int sourceType,
final int[] dstTypes,
final int dstIndex) {
final int dstIndex
) {
int dstType = dstTypes[dstIndex];
if (dstType == sourceType) {
// If the types are equal, merge(sourceType, dstType) = dstType, so there is no change.
Expand Down

0 comments on commit a201953

Please sign in to comment.