Core: optimize string splitting

- Mainly affects item loading performance
  - Reduces guild loading time a lot

--HG--
branch : trunk
This commit is contained in:
linencloth
2010-10-21 16:56:51 +02:00
parent f275f8b4b5
commit d9d1ec3670
9 changed files with 64 additions and 55 deletions
+2 -2
View File
@@ -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