Decompile fn_18368 (FillMessageBuckets)
Batch #12299 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_18368 FillMessageBuckets: logic confirmed by peer review Peer-reviewed-by: Yommy, Tanke, cremane Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
d9ff71a7fa
commit
97b862f0b0
1 changed files with 2 additions and 16 deletions
|
|
@ -4894,22 +4894,8 @@ bool CCommonObject::LoadCsv(const char* name, std::function<std::vector<std::str
|
|||
// OFFSET: 0x00B00360
|
||||
// FUNCTION: fn_18368
|
||||
void FillMessageBuckets(int* first, std::uintptr_t last, int* value) {
|
||||
int result = 0;
|
||||
int* dest = first;
|
||||
unsigned int count = (last - reinterpret_cast<std::uintptr_t>(first) + 3) >> 2;
|
||||
if (reinterpret_cast<std::uintptr_t>(first) > last) {
|
||||
count = 0;
|
||||
}
|
||||
if (count >= 4) {
|
||||
result = *value;
|
||||
if (first > value || &first[count - 1] < value) {
|
||||
unsigned int aligned = count & ~3u;
|
||||
dest = &first[aligned];
|
||||
__stosd(reinterpret_cast<unsigned long*>(first), static_cast<unsigned long>(result), aligned);
|
||||
}
|
||||
}
|
||||
for (; dest != reinterpret_cast<int*>(last); ++dest) {
|
||||
*dest = *value;
|
||||
for (; first != reinterpret_cast<int*>(last); ++first) {
|
||||
*first = *value;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue