summaryrefslogtreecommitdiff
path: root/firmware/common
diff options
context:
space:
mode:
authorFrank Dischner <phaedrus961@rockbox.org>2006-04-24 16:02:44 +0000
committerFrank Dischner <phaedrus961@rockbox.org>2006-04-24 16:02:44 +0000
commitbf64c451488a0e73ceda1fe45d4e9d0230ef1201 (patch)
tree1bebeedafaf674c9fa29c899f438b97e0e8b2509 /firmware/common
parent38ae72ac1e219a01b9e98528e4da410bbef2c565 (diff)
Use filesize instead of lseek to find the size of a file. Reduces disk access and improves font loading time.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9792 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/common')
-rw-r--r--firmware/common/unicode.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/firmware/common/unicode.c b/firmware/common/unicode.c
index 75165e49c7..83780393d5 100644
--- a/firmware/common/unicode.c
+++ b/firmware/common/unicode.c
@@ -62,8 +62,7 @@ int load_cp_table(int cp)
return 0;
}
- tablesize = lseek(file, 0, SEEK_END) / 2;
- lseek(file, 0, SEEK_SET);
+ tablesize = filesize(file) / 2;
if (tablesize > MAX_CP_TABLE_SIZE) {
DEBUGF("Invalid codepage file: %s.cp\n", filename[table-1]);