Example #1
0
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);
}
Example #2
0
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);
}
Example #3
0
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));
}
Example #4
0
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));
}
Example #5
0
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);
}
Example #6
0
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);
}