[PR #60] [MERGED] Use Stream.WriteByte, and don't allocate a new byte array #96

Open
opened 2026-01-30 21:27:06 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/claunia/plist-cil/pull/60
Author: @qmfrederik
Created: 6/12/2019
Status: Merged
Merged: 6/12/2019
Merged by: @claunia

Base: masterHead: fixes/write-byte


📝 Commits (2)

  • 6fce83d Use Stream.WriteByte, and don't allocate a new byte array
  • 467c981 Don't forget to increment count.

📊 Changes

1 file changed (+1 additions, -3 deletions)

View changed files

📝 plist-cil/BinaryPropertyListWriter.cs (+1 -3)

📄 Description

Stream has a Stream.WriteByte overload, so you don't need to create a new array just to write a single byte. Plus, throwaway arrays like this put pressure on the garbage collector.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/claunia/plist-cil/pull/60 **Author:** [@qmfrederik](https://github.com/qmfrederik) **Created:** 6/12/2019 **Status:** ✅ Merged **Merged:** 6/12/2019 **Merged by:** [@claunia](https://github.com/claunia) **Base:** `master` ← **Head:** `fixes/write-byte` --- ### 📝 Commits (2) - [`6fce83d`](https://github.com/claunia/plist-cil/commit/6fce83de9653366cdf7f2274d251205226b9fae3) Use Stream.WriteByte, and don't allocate a new byte array - [`467c981`](https://github.com/claunia/plist-cil/commit/467c9810c2663048b038d9234a16c390149531ca) Don't forget to increment count. ### 📊 Changes **1 file changed** (+1 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `plist-cil/BinaryPropertyListWriter.cs` (+1 -3) </details> ### 📄 Description Stream has a `Stream.WriteByte` overload, so you don't need to create a new array just to write a single byte. Plus, throwaway arrays like this put pressure on the garbage collector. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-30 21:27:06 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: claunia/plist-cil#96