Changeset 520 for trunk/admin/xcache.php


Ignore:
Timestamp:
2008-02-17T13:07:16+01:00 (7 years ago)
Author:
moo
Message:

fix overlaps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/xcache.php

    r517 r520  
    9191        $end = ($b['offset'] + $b['size']) / $size * $free_graph_width;
    9292
    93         $graph[(int) $begin] += 1 - ($begin - (int) $begin);
    94         $graph[(int) $end] += ($end - (int) $end);
    95         for ($i = (int) $begin + 1, $e = (int) $end; $i < $e; $i ++) {
    96             $graph[$i] = 1;
     93        if ((int) $begin == (int) $end) {
     94            $v = $end - $begin;
     95            $graph[(int) $v] += $v - (int) $v;
     96        }
     97        else {
     98            $graph[(int) $begin] += 1 - ($begin - (int) $begin);
     99            $graph[(int) $end] += $end - (int) $end;
     100            for ($i = (int) $begin + 1, $e = (int) $end; $i < $e; $i ++) {
     101                $graph[$i] += 1;
     102            }
    97103        }
    98104    }
Note: See TracChangeset for help on using the changeset viewer.