NFC replace 2 nested loops with 1 loop and a lookup for speed improvement.
This commit is contained in:
parent
bc4924ae47
commit
d974615d0e
@ -454,16 +454,16 @@ SSurface SSurface::MakeCopyTrimAgainst(SShell *parent,
|
|||||||
SEdgeList inter = {};
|
SEdgeList inter = {};
|
||||||
|
|
||||||
SSurface *ss;
|
SSurface *ss;
|
||||||
for(ss = agnst->surface.First(); ss; ss = agnst->surface.NextAfter(ss)) {
|
|
||||||
SCurve *sc;
|
SCurve *sc;
|
||||||
for(sc = into->curve.First(); sc; sc = into->curve.NextAfter(sc)) {
|
for(sc = into->curve.First(); sc; sc = into->curve.NextAfter(sc)) {
|
||||||
if(sc->source != SCurve::Source::INTERSECTION) continue;
|
if(sc->source != SCurve::Source::INTERSECTION) continue;
|
||||||
if(opA) {
|
if(opA) {
|
||||||
if(sc->surfA != h || sc->surfB != ss->h) continue;
|
if(sc->surfA != h) continue;
|
||||||
|
ss = shb->surface.FindById(sc->surfB);
|
||||||
} else {
|
} else {
|
||||||
if(sc->surfB != h || sc->surfA != ss->h) continue;
|
if(sc->surfB != h) continue;
|
||||||
|
ss = sha->surface.FindById(sc->surfA);
|
||||||
}
|
}
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for(i = 1; i < sc->pts.n; i++) {
|
for(i = 1; i < sc->pts.n; i++) {
|
||||||
Vector a = sc->pts[i-1].p,
|
Vector a = sc->pts[i-1].p,
|
||||||
@ -500,7 +500,6 @@ SSurface SSurface::MakeCopyTrimAgainst(SShell *parent,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Record all the points where more than two edges join, which I will call
|
// Record all the points where more than two edges join, which I will call
|
||||||
// the choosing points. If two edges join at a non-choosing point, then
|
// the choosing points. If two edges join at a non-choosing point, then
|
||||||
|
Loading…
Reference in New Issue
Block a user