void LocationPath::appendStep(Step* step) { unsigned stepCount = m_steps.size(); if (stepCount && optimizeStepPair(m_steps[stepCount - 1], step)) return; step->optimize(); m_steps.append(step); }
void LocationPath::insertFirstStep(Step* step) { if (m_steps.size() && optimizeStepPair(step, m_steps[0])) { m_steps[0] = step; return; } step->optimize(); m_steps.insert(0, step); }
void LocationPath::appendStep(std::unique_ptr<Step> step) { unsigned stepCount = m_steps.size(); if (stepCount) { bool dropSecondStep; optimizeStepPair(*m_steps[stepCount - 1], *step, dropSecondStep); if (dropSecondStep) return; } step->optimize(); m_steps.append(WTF::move(step)); }
void LocationPath::prependStep(std::unique_ptr<Step> step) { if (m_steps.size()) { bool dropSecondStep; optimizeStepPair(*step, *m_steps[0], dropSecondStep); if (dropSecondStep) { m_steps[0] = WTF::move(step); return; } } step->optimize(); m_steps.insert(0, WTF::move(step)); }
void LocationPath::insertFirstStep(Step* step) { if (m_steps.size()) { bool dropSecondStep; optimizeStepPair(step, m_steps[0], dropSecondStep); if (dropSecondStep) { delete m_steps[0]; m_steps[0] = step; return; } } step->optimize(); m_steps.insert(0, step); }
void LocationPath::appendStep(Step* step) { unsigned stepCount = m_steps.size(); if (stepCount) { bool dropSecondStep; optimizeStepPair(m_steps[stepCount - 1], step, dropSecondStep); if (dropSecondStep) { delete step; return; } } step->optimize(); m_steps.append(step); }