mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-17 01:33:16 +03:00
Ensure no division by zero occours if no time has ever been spent writing llcache
This commit is contained in:
parent
f9ccd65545
commit
5464dc7778
@ -3272,9 +3272,13 @@ llcache_initialise(const struct llcache_parameters *prm)
|
||||
void llcache_finalise(void)
|
||||
{
|
||||
llcache_object *object, *next;
|
||||
unsigned long total_bandwidth; /* total bandwidth */
|
||||
unsigned long total_bandwidth = 0; /* total bandwidth */
|
||||
|
||||
if (llcache->total_elapsed > 0) {
|
||||
total_bandwidth = (llcache->total_written * 1000) /
|
||||
llcache->total_elapsed;
|
||||
}
|
||||
|
||||
total_bandwidth = (llcache->total_written * 1000) / llcache->total_elapsed;
|
||||
/* Clean uncached objects */
|
||||
for (object = llcache->uncached_objects; object != NULL; object = next) {
|
||||
llcache_object_user *user, *next_user;
|
||||
|
Loading…
Reference in New Issue
Block a user