// Read a block of data into the buffer
size_t bytes_read = fread(file->buffer, 1, sizeof(file->buffer), file->f);
- if (bytes_read < sizeof(file->buffer) && ferror(file->f)) {
+ if (unlikely(bytes_read < sizeof(file->buffer) && ferror(file->f))) {
archive_set_error(a, errno, "Error reading file");
}
int r;
// Skip if we don't support seek
- if (file->flags & PAKFIRE_ARCHIVE_FILE_CANT_SEEK)
+ if (unlikely(file->flags & PAKFIRE_ARCHIVE_FILE_CANT_SEEK))
return 0;
// Skip if we have been asked to do nothing
- if (skip == 0)
+ if (unlikely(skip == 0))
return 0;
// Perform seek()
}
// Format >= 6
- if (archive->format >= 6) {
+ if (likely(archive->format >= 6)) {
// Parse PKGINFO
if (strcmp(path, ".PKGINFO") == 0) {
r = pakfire_archive_parse_json_metadata(archive, data, length);
const char* path = archive_entry_pathname(entry);
// Format >= 6
- if (archive->format >= 6) {
+ if (likely(archive->format >= 6)) {
// Anything that starts with "." is a metadata file
if (*path == '.')
return PAKFIRE_WALK_OK;