Author: andy
Date: Wed Feb 27 10:14:08 2008
New Revision: 2063
URL: http://svn.slimdevices.com?rev=2063&root=Jive&view=rev
Log:
Bug 7330, keep Jive from requesting a last chunk if it already has all items
Modified:
branches/7.0/jive/src/pkg/jive/share/applets/SlimBrowser/DB.lua
Modified: branches/7.0/jive/src/pkg/jive/share/applets/SlimBrowser/DB.lua
URL:
http://svn.slimdevices.com/branches/7.0/jive/src/pkg/jive/share/applets/SlimBrowser/DB.lua?rev=2063&root=Jive&r1=2062&r2=2063&view=diff
==============================================================================
--- branches/7.0/jive/src/pkg/jive/share/applets/SlimBrowser/DB.lua (original)
+++ branches/7.0/jive/src/pkg/jive/share/applets/SlimBrowser/DB.lua Wed Feb 27
10:14:08 2008
@@ -231,14 +231,19 @@
if not self.store[0] then
return 0, BLOCK_SIZE
end
+
+ local count = tonumber(self.last_chunk.count)
-- load last chunk
- local lastKey = math.modf(self.last_chunk.count / BLOCK_SIZE)
- if not self.store[lastKey] then
- if lastKey * BLOCK_SIZE != self.last_chunk.count then
- return lastKey * BLOCK_SIZE, BLOCK_SIZE
- else
- return lastKey * BLOCK_SIZE - 1, BLOCK_SIZE
+ local lastKey = 0
+ if count > BLOCK_SIZE then
+ lastKey = math.modf(count / BLOCK_SIZE)
+ if not self.store[lastKey] then
+ if lastKey * BLOCK_SIZE != count then
+ return lastKey * BLOCK_SIZE, BLOCK_SIZE
+ else
+ return lastKey * BLOCK_SIZE - 1, BLOCK_SIZE
+ end
end
end
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins