From 8ac9aa9f90b608421098efb563a065f8787dbd6f Mon Sep 17 00:00:00 2001 From: Teddy Date: Thu, 15 Aug 2013 20:25:37 +0800 Subject: remove unnecessary std::set in gc --- gc.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gc.h') diff --git a/gc.h b/gc.h index 9f1aca6..ad8ac6b 100644 --- a/gc.h +++ b/gc.h @@ -12,8 +12,12 @@ class GarbageCollector; #define GC_CYC_TRIGGER(ptr) \ do { \ - if ((ptr) && (ptr)->is_container() && !visited.count(ptr)) \ - visited.insert(*tail++ = (ptr)); \ + if ((ptr) && (ptr)->is_container() && \ + !(static_cast(ptr)->keep)) \ + { \ + static_cast(ptr)->keep = true; \ + *tail++ = (ptr); \ + } \ } while (0) #define GC_CYC_DEC(ptr) \ -- cgit v1.2.3