diff --git a/src/db/db/dbAsIfFlatRegion.cc b/src/db/db/dbAsIfFlatRegion.cc index 0001342df..e0bb9dd4e 100644 --- a/src/db/db/dbAsIfFlatRegion.cc +++ b/src/db/db/dbAsIfFlatRegion.cc @@ -1038,6 +1038,7 @@ AsIfFlatRegion::run_check (db::edge_relation_type rel, bool different_polygons, #if defined(USE_LOCAL_PROCESSOR) bool needs_merged_primary = different_polygons || options.needs_merged (); +needs_merged_primary = true; // @@@ db::RegionIterator polygons (needs_merged_primary ? begin_merged () : begin ()); bool primary_is_merged = ! merged_semantics () || needs_merged_primary || is_merged (); diff --git a/src/db/db/dbHash.h b/src/db/db/dbHash.h index 59d9b882b..9ed98ae0b 100644 --- a/src/db/db/dbHash.h +++ b/src/db/db/dbHash.h @@ -252,8 +252,15 @@ namespace std h = hfunc_coord (o.bgn_ext (), h); h = hfunc_coord (o.end_ext (), h); h = hfunc_coord (o.width (), h); + // NOTE: using too many points for the hash function just slows down the code. + unsigned int n = 20; for (typename db::path::iterator p = o.begin (); p != o.end (); ++p) { - h = hfunc (*p, h); + if (--n == 0) { + h = hfunc (o.points (), h); + break; + } else { + h = hfunc (*p, h); + } } return h; } @@ -280,8 +287,15 @@ namespace std template size_t hfunc (const db::polygon_contour &o, size_t h) { + // NOTE: using too many points for the hash function just slows down the code. + unsigned int n = 20; for (typename db::polygon_contour::simple_iterator i = o.begin (); i != o.end (); ++i) { - h = hfunc (*i, h); + if (--n == 0) { + h = hfunc (o.size (), h); + break; + } else { + h = hfunc (*i, h); + } } return h; } @@ -309,8 +323,15 @@ namespace std size_t hfunc (const db::polygon &o, size_t h) { h = hfunc (o.hull (), h); + // NOTE: using too many points for the hash function just slows down the code. + unsigned int n = 20; for (size_t i = 0; i < o.holes (); ++i) { - h = hfunc (o.hole (int (i)), h); + if (--n == 0) { + h = hfunc (o.holes (), h); + break; + } else { + h = hfunc (o.hole (int (i)), h); + } } return h; } @@ -514,13 +535,13 @@ namespace std template size_t hfunc (const db::shape_ref &o, size_t h) { - return hfunc ((size_t) o.ptr (), hfunc (o.trans (), h)); + return hfunc (*o.ptr (), hfunc (o.trans (), h)); } template size_t hfunc (const db::shape_ref &o) { - return hfunc ((size_t) o.ptr (), hfunc (o.trans ())); + return hfunc (*o.ptr (), hfunc (o.trans ())); } template @@ -539,13 +560,13 @@ namespace std template size_t hfunc (const db::polygon_ref &o, size_t h) { - return hfunc ((size_t) o.ptr (), hfunc (o.trans (), h)); + return hfunc (*o.ptr (), hfunc (o.trans (), h)); } template size_t hfunc (const db::polygon_ref &o) { - return hfunc ((size_t) o.ptr (), hfunc (o.trans ())); + return hfunc (*o.ptr (), hfunc (o.trans ())); } template @@ -564,13 +585,13 @@ namespace std template size_t hfunc (const db::path_ref &o, size_t h) { - return hfunc ((size_t) o.ptr (), hfunc (o.trans (), h)); + return hfunc (*o.ptr (), hfunc (o.trans (), h)); } template size_t hfunc (const db::path_ref &o) { - return hfunc ((size_t) o.ptr (), hfunc (o.trans ())); + return hfunc (*o.ptr (), hfunc (o.trans ())); } template @@ -589,13 +610,13 @@ namespace std template size_t hfunc (const db::text_ref &o, size_t h) { - return hfunc ((size_t) o.ptr (), hfunc (o.trans (), h)); + return hfunc (*o.ptr (), hfunc (o.trans (), h)); } template size_t hfunc (const db::text_ref &o) { - return hfunc ((size_t) o.ptr (), hfunc (o.trans ())); + return hfunc (*o.ptr (), hfunc (o.trans ())); } template