Skip to content

Replace Size with ByteSize#482

Merged
JakeWharton merged 1 commit into
JakeWharton:trunkfrom
Goooler:replace-size
Mar 16, 2026
Merged

Replace Size with ByteSize#482
JakeWharton merged 1 commit into
JakeWharton:trunkfrom
Goooler:replace-size

Conversation

@Goooler

@Goooler Goooler commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Comment on lines +27 to +28
assertThat(entry.compressedSize).isEqualTo(7.binaryBytes)
assertThat(entry.uncompressedSize).isEqualTo(5.binaryBytes)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent

Comment on lines +6 to +7
val BinaryByteSize.absoluteValue: BinaryByteSize
get() = BinaryByteSize(inWholeBytes.absoluteValue)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only used in one place. We can inline it.

@Goooler Goooler Mar 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sending a PR to add this for BinaryByteSize, so we can todo and remove it later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

val ZERO = Size(0)
}
}
operator fun BinaryByteSize.unaryMinus() = BinaryByteSize(-inWholeBytes)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread formats/api/formats.api Outdated
Comment on lines +103 to +104
public final fun component3-7zWN8Bo ()J
public final fun component4-7zWN8Bo ()J

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, will address that in a follow-up.

Comment thread formats/src/main/kotlin/com/jakewharton/diffuse/format/ArchiveFile.kt Outdated
Comment thread reports/src/main/kotlin/com/jakewharton/diffuse/diff/ArchiveFilesDiff.kt Outdated
@Goooler Goooler changed the title Replace Size with BinaryByteSize Replace Size with ByteSize Mar 16, 2026
@JakeWharton JakeWharton merged commit 8a3322c into JakeWharton:trunk Mar 16, 2026
1 check passed
@Goooler Goooler deleted the replace-size branch March 16, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants