Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: VertexArray::getBounds() can be optimized!  (Read 1416 times)

0 Members and 1 Guest are viewing this topic.

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
VertexArray::getBounds() can be optimized!
« 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. :)
JSFML - The Java binding to SFML.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: VertexArray::getBounds() can be optimized!
« Reply #1 on: August 24, 2012, 04:17:43 pm »
Yes :P
Laurent Gomila - SFML developer