API - Do not validate input length to String Truncate Transform on every call
Working on #5431, I noticed that we are validating the input length to the String truncate transform in every call for every value.
However, the input length has already been validated when the transform is instantiated.
Given that this code runs in the per-record path of each string truncate transformation, I've separated the validation logic from the truncation logic to allow skipping length validation for the case when it's already been validated / is constant after validation.
Did you mean to use the new method somewhere?
Also, I don't think that we want to use "unsafe" in the name. This is not unsafe, it is a different method contract.
The validation seems redundant but I'd also play around with the method name.
The validation seems redundant but I'd also play around with the method name.
+1 to the name thing. I changed it to truncateStringWithoutLengthValidation, which is better but I don't really love that either.
I'm open to suggestions if anybody has any. I would potentially change the name of the original function to truncateStringWithLengthValidation and make this the new function definition for the shorter name, but that involves updating more calls.