- string sCurrentPrecalcPathName = "";\r
- string sCurrentPrecalcIndexPathName = "";\r
- long unsigned int offset;\r
-\r
- int i;\r
- for (i = 0; i < (int)vPrecalcFiles.size() && gotPrecalcOnLine == -1; i++)\r
- {\r
- sCurrentPrecalcPathName = vPrecalcFiles[i];\r
- sCurrentPrecalcIndexPathName = sCurrentPrecalcPathName + ".index";\r
-\r
- offset = 0;\r
-\r
- vector<string> precalcLines;\r
- if (ReadLinesFromFile(sCurrentPrecalcIndexPathName.c_str(), precalcLines))\r
- {\r
- int j;\r
- for (j = 0; j < (int)precalcLines.size(); j++)\r
- {\r
- if (precalcString.compare(0, precalcString.size()-1, precalcLines[j]) == 0)\r
- {\r
- gotPrecalcOnLine = j;\r
- break;\r
- }\r
-\r
- // Parse\r
- vector<string> vPart;\r
- if (SeparateString(precalcLines[j], "___:", vPart))\r
- {\r
- // add to offset\r
- offset += ((atoi(vPart[3].c_str())-1) * sizeof(uint64));\r
- }\r
- else {\r
- // corrupt file\r
- printf("Corrupted precalculation file!\n");\r
- gotPrecalcOnLine = -1;\r
- break;\r
- }\r
- }\r
- }\r
+ map<string, pair<int, unsigned long int> >::const_iterator precalc_it =\r
+ mPrecalcIndex.find(precalculationLine);\r
+ if (precalc_it == mPrecalcIndex.end()) {\r
+ return false;\r