⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smallstringhash.h

📁 hl2 source code. Do not use it illegal.
💻 H
字号:
/*----------------------------------------------------------------------
Copyright (c) 1998 Gipsysoft. All Rights Reserved.
Please see the file "licence.txt" for licencing details.

File:	SmallStringHash.h
Owner:	rich@woodbridgeinternalmed.com
Purpose:	Hash method for CSmallString
----------------------------------------------------------------------*/
#ifndef SMALLSTRINGHASH_H
#define SMALLSTRINGHASH_H

namespace Container
{
	inline UINT HashIt( const StringClass& s)
	{
		UINT uHash = 0;
		LPCTSTR pcszText = s;
		if (!pcszText)
			return 0;
		while( *pcszText )
		{
			uHash = uHash << 1 ^ toupper( *pcszText++ );
		}
		return uHash;
	}

	inline bool ElementsTheSame( const StringClass& lhs, const StringClass& rhs )
	{
		return !lhs.Compare(rhs);
	}

}

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -