Skip to content

Commit

Permalink
Fix incomplete sentences in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
popematt authored and tgregg committed Jun 28, 2024
1 parent 8336f53 commit caf788b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/test/java/com/amazon/ion/impl/bin/PresenceBitmapTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,16 @@ class PresenceBitmapTest {

/**
* The purpose of this utility function is to create a bit string containing a whole number
* of little endian bytes that represents a list of
* of little endian bytes that represents a list of presence bit pairs.
*/
private fun createBitStringFromParameterPresences(parameterPresences: List<Long>): String {
val sb = StringBuilder()
(0 until (((parameterPresences.size + 3) / 4) * 4)).forEach { i ->
// Calculate the number of bit-pairs needed to have a whole number of bytes.
val n = (((parameterPresences.size + 3) / 4) * 4)
for (i in 0 until n) {
// Calculate the little-endian position
val ii = i - 2 * (i % 4) + 3
// If we go beyond the
// If `getOrNull` returns null, we've gone past the end of the presence values, so pad with zeros
val parameterPresence = parameterPresences.getOrNull(ii) ?: 0
val bits = when (parameterPresence) {
0L -> "00"
Expand Down

0 comments on commit caf788b

Please sign in to comment.