X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftag.cpp;h=c5824aec4e114d60b04c53acd00ae2b54072f7fe;hp=3586507a5f8ba17c35a560b55fdbfb6990290672;hb=HEAD;hpb=b617c5d7b5283ad260a77f01e42e6170cabbc03d diff --git a/source/tag.cpp b/source/tag.cpp deleted file mode 100644 index 3586507a..00000000 --- a/source/tag.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007, 2010 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#include "tag.h" - -namespace { - -template -inline unsigned hash(T begin, T end) -{ - unsigned result = 0; - for(T i=begin; (i!=end && *i); ++i) - result = ((result>>29)|(result<<5))^static_cast(*i); - return result; -} - -} - -namespace Msp { -namespace GL { - -Tag::Tag(const char *s): - id(s ? hash(s, 0) : 0) -{ } - -Tag::Tag(const std::string &s): - id(hash(s.begin(), s.end())) -{ } - -} // namespace GL -} // namespace Msp