From 95413d03508c5199d3203bb29d8e3dd0358db977 Mon Sep 17 00:00:00 2001 From: uz Date: Sun, 3 Jun 2012 16:49:23 +0000 Subject: [PATCH] Small optimization for shorter code. git-svn-id: svn://svn.cc65.org/cc65/trunk@5681 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/cbm/readdir.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libsrc/cbm/readdir.c b/libsrc/cbm/readdir.c index 678c343fc..e93c88137 100644 --- a/libsrc/cbm/readdir.c +++ b/libsrc/cbm/readdir.c @@ -38,9 +38,6 @@ struct dirent* __fastcall__ readdir (register DIR* dir) goto exitpoint; } - /* Adjust the directory offset */ - dir->off += 4; - /* Read the next file entry into the buffer */ for (count = 0, b = buffer; count < sizeof (buffer); ++b) { if (!_dirread1 (dir, b)) { @@ -52,8 +49,8 @@ struct dirent* __fastcall__ readdir (register DIR* dir) } } - /* Bump the directory offset */ - dir->off += count; + /* Bump the directory offset and include the bytes for line-link and size */ + dir->off += count + 4; /* End of directory is reached if the buffer contains "blocks free". It is * sufficient here to check for the leading 'b'. buffer will contain at