Hi, there, lately I been trying to script a component that calculates the **intersection of a set closed curves**, its a pretty simple iterative method, but I can’t figure out how to make it run faster. **Any Ideas**…???.

Here I’m leaving the method for both **C#** and **Python**(and the example file). I know that you can make faster recursive functions with **memoization**, but according to **@AndersDeleuran**, it’s probably slower than an iterative function and in C# by using **linq** but I’m not sure, linq still is a little bit cryptic to me. **Thanks** !!!

https://discourse.mcneel.com/t/seldup-equivalent-in-python/42520/8

```
public Curve AllIntersection(List<Curve> set_list)
{
Curve result = set_list[0];
foreach(Curve s in set_list.Skip(1)){
result = Rhino.Geometry.Curve.CreateBooleanIntersection(result, s)[0];
}
return result;
}
```

```
import Rhino
def allIntersection(set_list):
result = set_list[0]
for s in set_list[1:]:
result = Rhino.Geometry.Curve.CreateBooleanIntersection(result,s)[0]
return result
```

Faster Iterative Function.gh (6.0 KB)