mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-08-08 12:24:45 +00:00
test[map]: update tree map comment
This commit is contained in:
@@ -18,6 +18,8 @@ import com.zfoo.net.packet.common.PairIntLong;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 性能更高,但是可能会浪费一定的内存
|
||||
*
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
|
||||
@@ -403,15 +403,16 @@ public class TreeMapTest {
|
||||
|
||||
@Test
|
||||
public void testCelling() {
|
||||
var max = 10000;
|
||||
var start = 10000;
|
||||
var end = 20000;
|
||||
TreeMapIntLong treeMap = new TreeMapIntLong(200);
|
||||
for (int i = 0; i < max; i++) {
|
||||
for (int i = start; i < end; i++) {
|
||||
if (i % 2 == 0) {
|
||||
treeMap.put(i, i);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < max; i++) {
|
||||
if (i % 2 != 0 && i != (max - 1)) {
|
||||
for (int i = start; i < end; i++) {
|
||||
if (i % 2 != 0 && i != (end - 1)) {
|
||||
Assert.assertEquals(treeMap.ceilingEntry(i).getValue(), i + 1);
|
||||
}
|
||||
if (i % 2 != 0) {
|
||||
|
||||
Reference in New Issue
Block a user