Code simplified as the benefit did not outweigh complexity

This commit is contained in:
Simon Rozman 2016-05-26 16:27:55 +02:00
parent 6c82b6333f
commit c195a07982
2 changed files with 1 additions and 12 deletions

View File

@ -61,7 +61,6 @@ void ZRCola::DBSource::character_bank::build_related()
ZRCola::DBSource::character_bank::build_related_worker::build_related_worker(_In_ character_bank *cb, _In_ size_type from, _In_ size_type to) : ZRCola::DBSource::character_bank::build_related_worker::build_related_worker(_In_ character_bank *cb, _In_ size_type from, _In_ size_type to) :
thread_type((HANDLE)_beginthreadex(NULL, 0, process, this, CREATE_SUSPENDED, NULL)), thread_type((HANDLE)_beginthreadex(NULL, 0, process, this, CREATE_SUSPENDED, NULL)),
m_heap(HeapCreate(0, 0, 0)),
m_cb(cb), m_cb(cb),
m_from(from), m_from(from),
m_to(to) m_to(to)
@ -71,17 +70,9 @@ ZRCola::DBSource::character_bank::build_related_worker::build_related_worker(_In
} }
ZRCola::DBSource::character_bank::build_related_worker::~build_related_worker()
{
assert(m_heap);
HeapDestroy(m_heap);
}
unsigned int ZRCola::DBSource::character_bank::build_related_worker::process() unsigned int ZRCola::DBSource::character_bank::build_related_worker::process()
{ {
heap_allocator<wchar_t> al(m_heap); wstring rel;
basic_string<wchar_t, char_traits<wchar_t>, heap_allocator<wchar_t> > rel(al);
for (size_type i = m_from; i < m_to; i++) { for (size_type i = m_from; i < m_to; i++) {
ZRCola::DBSource::character &chr = *(m_cb->at(i).get()); ZRCola::DBSource::character &chr = *(m_cb->at(i).get());

View File

@ -177,7 +177,6 @@ namespace ZRCola {
public: public:
build_related_worker(_In_ character_bank *cb, _In_ size_type from, _In_ size_type to); build_related_worker(_In_ character_bank *cb, _In_ size_type from, _In_ size_type to);
virtual ~build_related_worker();
inline void join() inline void join()
{ {
@ -200,7 +199,6 @@ namespace ZRCola {
protected: protected:
character_bank *m_cb; character_bank *m_cb;
size_type m_from, m_to; size_type m_from, m_to;
HANDLE m_heap;
}; };
}; };