Skip to content

Change occurances of truncate(0) to clear#9593

Open
Rafferty97 wants to merge 1 commit intoapache:mainfrom
Rafferty97:truncate-zero
Open

Change occurances of truncate(0) to clear#9593
Rafferty97 wants to merge 1 commit intoapache:mainfrom
Rafferty97:truncate-zero

Conversation

@Rafferty97
Copy link
Contributor

Which issue does this PR close?

In response to a comment on #9494, I have searched for occurances of truncate(0) and replaced them with clear to be more idiomatic. I know it's only a minor stylistic change, but it does help with code readability.

In the process, I also noticed and fixed an inconsistency between MutableBuffer::truncate and MutableBuffer::clear. Not sure if this is a latent bug or actually benign.

Rationale for this change

Explained above

What changes are included in this PR?

  • Replace a few instances of truncate(0) with clear
  • Fix MutableBuffer::clear to be consistent with MutableBuffer::truncate

Are these changes tested?

Yes, the existing test suite passes.

Are there any user-facing changes?

No

`Vec`s but also one `MutableBuffer`. I also noticed and fixed an
inconsistency between `MutableBuffer::truncate` and
`MutableBuffer::clear`.
@github-actions github-actions bot added parquet Changes to the parquet crate arrow Changes to the arrow crate labels Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants