reduceRightOrNull

inline fun ByteBuffer.reduceRightOrNull(operation: (Byte, acc: Byte) -> Byte): Byte?
inline fun ShortBuffer.reduceRightOrNull(operation: (Short, acc: Short) -> Short): Short?
inline fun IntBuffer.reduceRightOrNull(operation: (Int, acc: Int) -> Int): Int?
inline fun LongBuffer.reduceRightOrNull(operation: (Long, acc: Long) -> Long): Long?
inline fun FloatBuffer.reduceRightOrNull(operation: (Float, acc: Float) -> Float): Float?
inline fun DoubleBuffer.reduceRightOrNull(operation: (Double, acc: Double) -> Double): Double?
inline fun CharBuffer.reduceRightOrNull(operation: (Char, acc: Char) -> Char): Char?

Accumulates value starting with the last element and applying operation from right to left to each element and current accumulator value.

Returns null if the array is empty.

Samples

kool.buffers.Collections.Aggregates.reduceRightOrNull

Parameters

operation

function that takes an element and current accumulator value, and calculates the next accumulator value.