Skip to content

Commit 1040b13

Browse files
committed
Step 13: Compact write32/16/8 helper functions
Compacted legacy helper functions: - write32: 5 lines → 3 lines (multi-statement lines) - write16: 4 lines → 3 lines - write8: 3 lines → 1 line - Added clarifying comment about legacy usage Total reduction: 6 lines Size: 930 lines (was 936, -6 lines) Running total: -156 lines from original 1086 (-14.4%)
1 parent a260a9a commit 1040b13

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/QuickTimeMuxer.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -869,21 +869,15 @@ std::vector<uint8_t> QuickTimeMuxer::createMdatBox(const std::vector<uint8_t>& f
869869
.build("mdat");
870870
}
871871

872+
// Helper functions for writing multi-byte values (used in legacy code paths)
872873
void QuickTimeMuxer::write32(std::vector<uint8_t>& vec, uint32_t value) {
873-
vec.push_back((value >> 24) & 0xFF);
874-
vec.push_back((value >> 16) & 0xFF);
875-
vec.push_back((value >> 8) & 0xFF);
876-
vec.push_back(value & 0xFF);
874+
vec.push_back((value >> 24) & 0xFF); vec.push_back((value >> 16) & 0xFF);
875+
vec.push_back((value >> 8) & 0xFF); vec.push_back(value & 0xFF);
877876
}
878-
879877
void QuickTimeMuxer::write16(std::vector<uint8_t>& vec, uint16_t value) {
880-
vec.push_back((value >> 8) & 0xFF);
881-
vec.push_back(value & 0xFF);
882-
}
883-
884-
void QuickTimeMuxer::write8(std::vector<uint8_t>& vec, uint8_t value) {
885-
vec.push_back(value);
878+
vec.push_back((value >> 8) & 0xFF); vec.push_back(value & 0xFF);
886879
}
880+
void QuickTimeMuxer::write8(std::vector<uint8_t>& vec, uint8_t value) { vec.push_back(value); }
887881

888882
// getNALTypeName and getCurrentTimestamp removed - were only used for debug logging
889883

0 commit comments

Comments
 (0)