Core: optimize string splitting
- Mainly affects item loading performance - Reduces guild loading time a lot --HG-- branch : trunk
This commit is contained in:
@@ -418,10 +418,10 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, Field* fields, uint32 entr
|
||||
need_save = true;
|
||||
}
|
||||
|
||||
Tokens tokens = StrSplit(fields[4].GetString(), " ");
|
||||
Tokens tokens(fields[4].GetString(), ' ', MAX_ITEM_PROTO_SPELLS);
|
||||
if (tokens.size() == MAX_ITEM_PROTO_SPELLS)
|
||||
for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
|
||||
SetSpellCharges(i, atoi(tokens[i].c_str()));
|
||||
SetSpellCharges(i, atoi(tokens[i]));
|
||||
|
||||
SetUInt32Value(ITEM_FIELD_FLAGS, fields[5].GetUInt32());
|
||||
// Remove bind flag for items vs NO_BIND set
|
||||
|
||||
Reference in New Issue
Block a user