[Assorted-commits] SF.net SVN: assorted:[1284] cpp-commons/trunk/src/commons/fast_map.h
Brought to you by:
yangzhang
From: <yan...@us...> - 2009-03-12 17:24:01
|
Revision: 1284 http://assorted.svn.sourceforge.net/assorted/?rev=1284&view=rev Author: yangzhang Date: 2009-03-12 17:23:53 +0000 (Thu, 12 Mar 2009) Log Message: ----------- reformatting Modified Paths: -------------- cpp-commons/trunk/src/commons/fast_map.h Modified: cpp-commons/trunk/src/commons/fast_map.h =================================================================== --- cpp-commons/trunk/src/commons/fast_map.h 2009-03-12 02:13:29 UTC (rev 1283) +++ cpp-commons/trunk/src/commons/fast_map.h 2009-03-12 17:23:53 UTC (rev 1284) @@ -153,7 +153,8 @@ void resize(size_t size) { commons::array<value_type> newtab(0); - newtab.reset(reinterpret_cast<value_type*>(new char[size * sizeof(value_type)]), size); + char *newtabarr = new char[size * sizeof(value_type)]; + newtab.reset(reinterpret_cast<value_type*>(newtabarr), size); for (size_t i = 0; i < size; ++i) newtab[i].first = empty_key; // Rehash old values over into new table. @@ -197,7 +198,9 @@ void erase(iterator) { throw_not_implemented(); } array<value_type> &get_table() { return table; } const array<value_type> &get_table() const { return table; } - bool empty_or_deleted(key_type k) const { return k == empty_key || k == deleted_key; } + bool empty_or_deleted(key_type k) const { + return k == empty_key || k == deleted_key; + } iterator begin() { assert_init(); @@ -258,7 +261,9 @@ // empty spot, try returning the earlier deleted spot first. If we // find the key, return that. for (; - table[pos].first != deleted_key && table[pos].first != empty_key && table[pos].first != k; + table[pos].first != deleted_key && + table[pos].first != empty_key && + table[pos].first != k; pos = (pos + ++probe) & mask) { assert(probe < table.size()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |