Add a flag to the dictionary generator to skip empty samples.

PiperOrigin-RevId: 875642399
This commit is contained in:
Brotli
2026-02-26 04:01:40 -08:00
committed by Copybara-Service
parent 51be27dbd9
commit 1bcd5c0d9e

View File

@@ -281,6 +281,10 @@ int main(int argc, char const* argv[]) {
const char* resolved_path = resolved_paths.gl_pathv[j];
#endif
std::string content = readFile(resolved_path);
if (content.empty()) {
fprintf(stderr, "Skipping empty sample: %s\n", resolved_path);
continue;
}
if (chunkLen == 0) {
paths.emplace_back(resolved_path);
data.insert(data.end(), content.begin(), content.end());