mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
use double type for average
This commit is contained in:
parent
fcd464f118
commit
c0d6599def
2 changed files with 4 additions and 3 deletions
|
@ -10,6 +10,7 @@
|
|||
* Source/NSURL.m: fix possible nul pointer dereference
|
||||
* Source/NSPropertyList.m: check step before use
|
||||
* Source/NSDate.m: add comment that we are ignoring non-digits
|
||||
* Source/NSCache.m: use double division for calcualting averrage
|
||||
|
||||
2018-02-05 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@
|
|||
_costLimit = lim;
|
||||
}
|
||||
|
||||
- (NSUInteger)totalCostLimit
|
||||
- (NSUInteger) totalCostLimit
|
||||
{
|
||||
return _costLimit;
|
||||
}
|
||||
|
@ -213,7 +213,7 @@
|
|||
{
|
||||
NSMutableArray *evictedKeys = nil;
|
||||
// Round up slightly.
|
||||
NSUInteger averageAccesses = (_totalAccesses / count * 0.2) + 1;
|
||||
NSUInteger averageAccesses = ((_totalAccesses / (double)count) * 0.2) + 1;
|
||||
NSEnumerator *e = [_accesses objectEnumerator];
|
||||
_GSCachedObject *obj;
|
||||
|
||||
|
@ -275,7 +275,7 @@
|
|||
@end
|
||||
|
||||
@implementation _GSCachedObject
|
||||
- (void)dealloc
|
||||
- (void) dealloc
|
||||
{
|
||||
[object release];
|
||||
[key release];
|
||||
|
|
Loading…
Reference in a new issue