/*------------------------------------------------------------------------------ * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team * * Distributable under the terms of either the Apache License (Version 2.0) or * the GNU Lesser General Public License, as specified in the COPYING file. ------------------------------------------------------------------------------*/ #include "CLucene/StdHeader.h" #include "Misc.h" #ifdef _CL_TIME_WITH_SYS_TIME # include # include #else # if defined(_CL_HAVE_SYS_TIME_H) # include # else # include # endif #endif #ifdef _CL_HAVE_SYS_TIMEB_H # include #endif CL_NS_DEF(util) size_t Misc::ahashCode(const char* str){ // Compute the hash code using a local variable to be reentrant. size_t hashCode = 0; while ( *str != 0 ) hashCode = hashCode * 31 + *str++; return hashCode; } size_t Misc::ahashCode(const char* str, size_t len){ // Compute the hash code using a local variable to be reentrant. size_t hashCode = 0; for (size_t i = 0; i