20 #ifndef TESSERACT_TRAINING_UTIL_H_ 21 #define TESSERACT_TRAINING_UTIL_H_ 35 const char* str = s.c_str();
36 for (
int ch = 0; str[ch] != 0; ++ch) {
37 hash_code += str[ch] << (ch % 24);
42 #else // COMPILER_MSVC 43 struct StringHash :
public stdext::hash_compare <std::string> {
44 size_t operator()(
const std::string& s)
const {
46 const char* str = s.c_str();
47 for (
int ch = 0; str[ch] != 0; ++ch) {
48 hash_code += str[ch] << (ch % 24);
52 bool operator()(
const std::string& s1,
const std::string& s2)
const {
56 #endif // !COMPILER_MSVC 58 #ifdef GOOGLE_TESSERACT 59 #include "base/heap-checker.h" 60 #define DISABLE_HEAP_LEAK_CHECK HeapLeakChecker::Disabler disabler 62 #define DISABLE_HEAP_LEAK_CHECK {} 65 #endif // TESSERACT_TRAINING_UTIL_H_
size_t operator()(const std::string &s) const
Definition: util.h:33