8287013: StringConcatFactory: remove short and byte mixers/prependers

Reviewed-by: jlaskey
This commit is contained in:
Claes Redestad 2022-05-20 08:17:23 +00:00
parent 828dc89ab8
commit d5d19f52ce
2 changed files with 13 additions and 75 deletions

View file

@ -68,17 +68,6 @@ final class StringConcatHelper {
return checkOverflow(lengthCoder + (value ? 4 : 5));
}
/**
* Mix value length and coder into current length and coder.
* @param lengthCoder String length with coder packed into higher bits
* the upper word.
* @param value value to mix in
* @return new length and coder
*/
static long mix(long lengthCoder, byte value) {
return mix(lengthCoder, (int)value);
}
/**
* Mix value length and coder into current length and coder.
* @param lengthCoder String length with coder packed into higher bits
@ -90,17 +79,6 @@ final class StringConcatHelper {
return checkOverflow(lengthCoder + 1) | (StringLatin1.canEncode(value) ? 0 : UTF16);
}
/**
* Mix value length and coder into current length and coder.
* @param lengthCoder String length with coder packed into higher bits
* the upper word.
* @param value value to mix in
* @return new length and coder
*/
static long mix(long lengthCoder, short value) {
return mix(lengthCoder, (int)value);
}
/**
* Mix value length and coder into current length and coder.
* @param lengthCoder String length with coder packed into higher bits
@ -198,23 +176,6 @@ final class StringConcatHelper {
return indexCoder;
}
/**
* Prepends constant and the stringly representation of value into buffer,
* given the coder and final index. Index is measured in chars, not in bytes!
*
* @param indexCoder final char index in the buffer, along with coder packed
* into higher bits.
* @param buf buffer to append to
* @param value boolean value to encode
* @param prefix a constant to prepend before value
* @return updated index (coder value retained)
*/
static long prepend(long indexCoder, byte[] buf, byte value, String prefix) {
indexCoder = prepend(indexCoder, buf, (int)value);
if (prefix != null) indexCoder = prepend(indexCoder, buf, prefix);
return indexCoder;
}
/**
* Prepends the stringly representation of char value into buffer,
* given the coder and final index. Index is measured in chars, not in bytes!
@ -251,23 +212,6 @@ final class StringConcatHelper {
return indexCoder;
}
/**
* Prepends constant and the stringly representation of value into buffer,
* given the coder and final index. Index is measured in chars, not in bytes!
*
* @param indexCoder final char index in the buffer, along with coder packed
* into higher bits.
* @param buf buffer to append to
* @param value boolean value to encode
* @param prefix a constant to prepend before value
* @return updated index (coder value retained)
*/
static long prepend(long indexCoder, byte[] buf, short value, String prefix) {
indexCoder = prepend(indexCoder, buf, (int)value);
if (prefix != null) indexCoder = prepend(indexCoder, buf, prefix);
return indexCoder;
}
/**
* Prepends the stringly representation of integer value into buffer,
* given the coder and final index. Index is measured in chars, not in bytes!