Review changes

This commit is contained in:
jpirnay
2026-05-04 17:27:21 +02:00
parent 5486eee4e3
commit e70fd281d9
3 changed files with 3 additions and 2 deletions
+1
View File
@@ -10,6 +10,7 @@ namespace FsHelpers {
// both normalisePath overloads so the parsing rules stay in one place. // both normalisePath overloads so the parsing rules stay in one place.
static void appendOrPopComponent(std::string& out, const char* compData, size_t compLen) { static void appendOrPopComponent(std::string& out, const char* compData, size_t compLen) {
if (compLen == 0) return; if (compLen == 0) return;
if (compLen == 1 && compData[0] == '.') return;
if (compLen == 2 && compData[0] == '.' && compData[1] == '.') { if (compLen == 2 && compData[0] == '.' && compData[1] == '.') {
if (out.empty()) return; if (out.empty()) return;
const auto lastSlash = out.find_last_of('/'); const auto lastSlash = out.find_last_of('/');
+1 -1
View File
@@ -295,7 +295,7 @@ bool ZipFile::getInflatedFileSize(const char* filename, size_t* size) {
return true; return true;
} }
int ZipFile::fillUncompressedSizes(std::vector<SizeTarget>& targets, std::vector<uint32_t>& sizes) { int ZipFile::fillUncompressedSizes(const std::vector<SizeTarget>& targets, std::vector<uint32_t>& sizes) {
if (targets.empty()) { if (targets.empty()) {
return 0; return 0;
} }
+1 -1
View File
@@ -64,7 +64,7 @@ class ZipFile {
// Batch lookup: scan ZIP central dir once and fill sizes for matching targets. // Batch lookup: scan ZIP central dir once and fill sizes for matching targets.
// targets must be sorted by (hash, len). sizes[target.index] receives uncompressedSize. // targets must be sorted by (hash, len). sizes[target.index] receives uncompressedSize.
// Returns number of targets matched. // Returns number of targets matched.
int fillUncompressedSizes(std::vector<SizeTarget>& targets, std::vector<uint32_t>& sizes); int fillUncompressedSizes(const std::vector<SizeTarget>& targets, std::vector<uint32_t>& sizes);
// Due to the memory required to run each of these, it is recommended to not preopen the zip file for multiple // Due to the memory required to run each of these, it is recommended to not preopen the zip file for multiple
// These functions will open and close the zip as needed // These functions will open and close the zip as needed
uint8_t* readFileToMemory(const char* filename, size_t* size = nullptr, bool trailingNullByte = false); uint8_t* readFileToMemory(const char* filename, size_t* size = nullptr, bool trailingNullByte = false);