This commit is contained in:
Branimir Karadžić
2015-08-13 20:27:06 -07:00
parent d9f164c7d4
commit 7e489d4c0c
2 changed files with 5 additions and 5 deletions

View File

@@ -260,7 +260,7 @@ namespace bx
link.m_prev = _handle;
}
updateFirstLast(_handle);
updateFrontBack(_handle);
}
void insertAfter(uint16_t _after, uint16_t _handle)
@@ -281,7 +281,7 @@ namespace bx
link.m_next = _handle;
}
updateFirstLast(_handle);
updateFrontBack(_handle);
}
bool isValid(uint16_t _handle) const
@@ -289,7 +289,7 @@ namespace bx
return _handle < MaxHandlesT;
}
void updateFirstLast(uint16_t _handle)
void updateFrontBack(uint16_t _handle)
{
Link& curr = m_links[_handle];

View File

@@ -68,9 +68,9 @@ TEST(HandleAllocLruT)
lru.alloc(),
};
lru.touch(handle[3]);
lru.touch(handle[1]);
uint16_t expected0[] = { handle[3], handle[0], handle[1], handle[2] };
uint16_t expected0[] = { handle[1], handle[3], handle[2], handle[0] };
uint16_t count = 0;
for (uint16_t it = lru.getFront(); it != UINT16_MAX; it = lru.getNext(it), ++count)
{