mirror of https://github.com/CGAL/cgal
Minor optimization for Lazy_kernel
if a dynamic_cast succeeded, don't try again with a different type.
This commit is contained in:
parent
4335b167b7
commit
62e6c41096
|
|
@ -329,8 +329,9 @@ public:
|
|||
|
||||
|
||||
LR * lr = dynamic_cast<LR*>(p.ptr());
|
||||
// Another thread could reset lr->l between the next 2 lines, so we disable reset for Construct_weighted_point_2 in MT-mode.
|
||||
// We could also always disable reset for Construct_weighted_point_2 and return lr->l here even if update_exact has run.
|
||||
if(lr && (! lr->et)){
|
||||
// FIXME: this is not thread-safe at all, some other thread could update_exact and clear l between the 2 lines. Same for the following functors.
|
||||
return std::get<2>(lr->l);
|
||||
}
|
||||
return BaseClass().compute_weight_2_object()(p);
|
||||
|
|
@ -409,7 +410,8 @@ public:
|
|||
> LRint;
|
||||
|
||||
LR * lr = dynamic_cast<LR*>(p.ptr());
|
||||
if(lr && (! lr->et)){
|
||||
if(lr){
|
||||
if(! lr->et)
|
||||
return std::get<1>(lr->l);
|
||||
} else {
|
||||
LRint* lrint = dynamic_cast<LRint*>(p.ptr());
|
||||
|
|
@ -464,7 +466,8 @@ public:
|
|||
|
||||
|
||||
LR * lr = dynamic_cast<LR*>(p.ptr());
|
||||
if(lr && (! lr->et)){
|
||||
if(lr){
|
||||
if(! lr->et)
|
||||
return std::get<1>(lr->l);
|
||||
}else{
|
||||
LRint* lrint = dynamic_cast<LRint*>(p.ptr());
|
||||
|
|
|
|||
Loading…
Reference in New Issue