From d7fd21411e7c2168cef2195c613133a71342127e Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Thu, 23 Jul 2009 15:15:20 -0700 Subject: Don't reload a chunk if it's the same chunk we're looking at diff --git a/fusearchive.py b/fusearchive.py index 316ff21..2d1f390 100755 --- a/fusearchive.py +++ b/fusearchive.py @@ -278,7 +278,7 @@ class FuseArchive(Fuse): self.modified = False # This is the current in-memory chunk and offset in to data[] - self.chunk = None + self.chunk = '' self.chunk_index = 0 self.chunk_modified = False self.chunk_size = magic_blocksize @@ -327,6 +327,12 @@ class FuseArchive(Fuse): dmsg( 3, str(self) + " init complete" ) def _load_chunk( self, index ): + # If the current chunk is the same as the chunk we're loading + # just return + if index == self.chunk_index: + dmsg( 3, "Load chunk is same as current chunk, all done" ) + return + # Save this chunk if modified self._save_chunk() -- cgit v0.10.2