|
22 | 22 | *
|
23 | 23 | **********************************************************************************/
|
24 | 24 |
|
| 25 | +#include <algorithm> |
25 | 26 | #include <iostream>
|
26 | 27 | #include <string>
|
27 | 28 | #include <fstream>
|
@@ -387,7 +388,7 @@ typedef map<string, Entry> EntryMap_t;
|
387 | 388 | typedef list<string> StringList_t;
|
388 | 389 | typedef list<NodeSPtr> NodeList_t;
|
389 | 390 | typedef set<StringInt> StringIntSet_t;
|
390 |
| -typedef basic_string<int> StringOfInts; |
| 391 | +typedef vector<int> StringOfInts; |
391 | 392 | typedef vector<unsigned int> UintVect;
|
392 | 393 | typedef vector<uint64_t> Uint64Vect;
|
393 | 394 | typedef vector<StringInt *> StrIntPtrVect_t;
|
@@ -864,15 +865,14 @@ void CreateArrays(NodeSPtr Root, StringIntSet_t & StrSet, StringOfInts & ChildAd
|
864 | 865 | for(Itc = Root->ChildBegin(); Itc != Root->ChildEnd(); ++Itc)
|
865 | 866 | {
|
866 | 867 | int i = Itc->second->GetAddr();
|
867 |
| - Chld += i; |
| 868 | + Chld.push_back(i); |
868 | 869 | }
|
869 | 870 | // Find where in pointer array the child pointer string is
|
870 |
| - StringOfInts::size_type x = ChildAddrs.find(Chld); |
871 |
| - if (x == StringOfInts::npos) |
| 871 | + StringOfInts::size_type x = search(ChildAddrs.begin(), ChildAddrs.end(), Chld.begin(), Chld.end()) - ChildAddrs.begin(); |
| 872 | + if (x == ChildAddrs.size()) |
872 | 873 | {
|
873 | 874 | // Not found, add it
|
874 |
| - x = ChildAddrs.length(); |
875 |
| - ChildAddrs += Chld; |
| 875 | + ChildAddrs.insert(ChildAddrs.end(), Chld.begin(), Chld.end()); |
876 | 876 | }
|
877 | 877 | // Val will contain the final node data
|
878 | 878 | uint64_t Val = Its->i;
|
|
0 commit comments