SFML community forums

Help => Graphics => Topic started by: pdinklag on August 24, 2012, 02:54:51 pm

Title: VertexArray::getBounds() can be optimized!
Post by: pdinklag on August 24, 2012, 02:54:51 pm
It's really minor, but I just noticed this:
        float left   = m_vertices[0].position.x;
        float top    = m_vertices[0].position.y;
        float right  = m_vertices[0].position.x;
        float bottom = m_vertices[0].position.y;

        for (std::size_t i = 0; i < m_vertices.size(); ++i)
        {

I suppose i can start counting at 1. :)
Title: Re: VertexArray::getBounds() can be optimized!
Post by: Laurent on August 24, 2012, 04:17:43 pm
Yes :P