Skip to content

Commit

Permalink
Corrected conditional pattern.
Browse files Browse the repository at this point in the history
git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@151 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
lucboudreau committed Mar 23, 2009
1 parent fd200e4 commit d3cda6c
Showing 1 changed file with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,18 +269,17 @@ private String timeBasedEviction(boolean makeRoom)
}

// Checks if this is the oldest entry.
//
// REVIEW (jhyde, 2009/2/20): are parens correct? makeRoom
// associates with LIFO but not FIFO
if (makeRoom &&
(evictionMode == XmlaOlap4jNamedMemoryCache.Mode.LIFO
if ((makeRoom &&
(evictionMode == XmlaOlap4jNamedMemoryCache.Mode.LIFO
&& entry.getValue().getTimestamp().longValue()
< currentEvictedTimestamp)
|| (evictionMode == XmlaOlap4jNamedMemoryCache.Mode.FIFO
&& entry.getValue().getTimestamp().longValue()
> currentEvictedTimestamp))
< currentEvictedTimestamp))
|| (makeRoom &&
(evictionMode == XmlaOlap4jNamedMemoryCache.Mode.FIFO
&& entry.getValue().getTimestamp().longValue()
> currentEvictedTimestamp)))
{
currentEvictedTimestamp = entry.getValue().getTimestamp().longValue();
currentEvictedTimestamp =
entry.getValue().getTimestamp().longValue();
toBeEvicted = entry.getKey();
}
}
Expand Down Expand Up @@ -322,14 +321,14 @@ private String hitBasedEviction(boolean makeRoom)
}

// Checks if this is the oldest entry.
// REVIEW: Same comments as above.
if (makeRoom &&
(evictionMode == Mode.LFU
if ((makeRoom &&
(evictionMode == Mode.LFU
&& entry.getValue().getHitCount().longValue()
< currentEvictedHits))
|| (makeRoom &&
(evictionMode == XmlaOlap4jNamedMemoryCache.Mode.MFU
&& entry.getValue().getHitCount().longValue()
< currentEvictedHits)
|| (evictionMode == XmlaOlap4jNamedMemoryCache.Mode.MFU
&& entry.getValue().getHitCount().longValue()
> currentEvictedHits))
> currentEvictedHits)))
{
currentEvictedHits = entry.getValue().getHitCount().longValue();
toBeEvicted = entry.getKey();
Expand Down

0 comments on commit d3cda6c

Please sign in to comment.