devkitPro / libfat

FAT library for GBA, DS, Gamecube & Wii
http://devkitpro.org/viewforum.php?f=24
54 stars 36 forks source link

Redundant function calls #3

Open FrankHB opened 9 years ago

FrankHB commented 9 years ago

In "source/file_allocation_table.c":

uint32_t _FAT_fat_lastCluster (PARTITION* partition, uint32_t cluster) {
    while ((_FAT_fat_nextCluster(partition, cluster) != CLUSTER_FREE) && (_FAT_fat_nextCluster(partition, cluster) != CLUSTER_EOF)) {
        cluster = _FAT_fat_nextCluster(partition, cluster);
    }
    return cluster;
}

It seems that mutiple '_FAT_fat_nextCluster' calls can be merged.