Skip to content

Commit

Permalink
Reduce file dependency count type to uint16_t.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuart6854 committed Nov 25, 2023
1 parent 8708e2d commit 6a68c10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gfs/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ namespace gfs
stream.write(reinterpret_cast<const char*>(pathStr.data()), strLen);

// File dependencies
const auto count = uint32_t(file.FileDependencies.size()); // #TODO: Can probably reduce this to a uint16_t (uint8_t?).
const auto count = uint16_t(file.FileDependencies.size());
stream.write(reinterpret_cast<const char*>(&count), sizeof(count));
if (!file.FileDependencies.empty())
stream.write(reinterpret_cast<const char*>(file.FileDependencies.data()), sizeof(file.FileDependencies[0]) * count);
Expand All @@ -433,7 +433,7 @@ namespace gfs
file.MountRelPath = pathStr;

// File dependencies
uint32_t count = 0;
uint16_t count = 0;
stream.read(reinterpret_cast<char*>(&count), sizeof(count));
file.FileDependencies.resize(count);
if (!file.FileDependencies.empty())
Expand Down

0 comments on commit 6a68c10

Please sign in to comment.