Perf improvement

This commit is contained in:
Oleg Zhurakousky
2022-03-18 14:47:44 +01:00
parent cb35adb588
commit a022defb3c

View File

@@ -548,7 +548,7 @@ public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspect
if (logger.isDebugEnabled() && !(input instanceof Publisher)) { if (logger.isDebugEnabled() && !(input instanceof Publisher)) {
logger.debug("Invoking function " + this); logger.debug("Invoking function " + this);
} }
Object result = this.doApply(input); Object result = (this.getTarget() instanceof PassThruFunction) ? input : this.doApply(input);
if (result != null && this.outputType != null) { if (result != null && this.outputType != null) {
result = this.convertOutputIfNecessary(result, this.outputType, this.expectedOutputContentType); result = this.convertOutputIfNecessary(result, this.outputType, this.expectedOutputContentType);
@@ -1448,4 +1448,11 @@ public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspect
return this.originalMessage; return this.originalMessage;
} }
} }
public static class PassThruFunction implements Function<Object, Object> {
@Override
public Object apply(Object t) {
return t;
}
}
} }