message: simplify: Reformat and minor code cleanup
  All edge analysis functions are now next to each other.
diff: @@ -78,18 +78,6 @@ static void buildEdgeAdjacency(EdgeAdjacency& adjacency, const unsigned int* ind
  }
  }
  -static bool findEdge(const EdgeAdjacency& adjacency, unsigned int a, unsigned int b)
  -{
  - unsigned int count = adjacency.counts[a];
  - const unsigned int* data = adjacency.data.data + adjacency.offsets[a];
  -
  - for (size_t i = 0; i < count; ++i)
  - if (data[i] == b)
  - return true;
  -
  - return false;
  -}
  -
  struct PositionHasher
  {
  const float* vertex_positions;
  @@ -229,23 +217,16 @@ const char kCanCollapse[Kind_Count][Kind_Count] = {
  {0, 0, 0, 0},
  };
  -static size_t countOpenEdges(const EdgeAdjacency& adjacency, unsigned int vertex, unsigned int* last = 0)
  +static bool findEdge(const EdgeAdjacency& adjacency, unsigned int a, unsigned int b)
  {
  - size_t result = 0;
  -
  - unsigned int count = adjacency.counts[vertex];
  - const unsigned int* data = adjacency.data.data + adjacency.offsets[vertex];
  + unsigned int count = adjacency.counts[a];
  + const unsigned int* data = adjacency.data.data + adjacency.offsets[a];
  for (size_t i = 0; i < count; ++i)
  - if (!findEdge(adjacency, data[i], vertex))
  - {
  - result++;
  -
  - if (last)
  - *last = data[i];
  - }
  + if (data[i] == b)
  + return true;
  - return result;
  + return false;
  }
  static bool findWedgeEdge(const EdgeAdjacency& adjacency, const unsigned int* wedge, unsigned int a, unsigned int b)
  @@ -258,12 +239,30 @@ static bool findWedgeEdge(const EdgeAdjacency& adjacency, const unsigned int* we
  return true;
  v = wedge[v];
  - }
  - while (v != a);
  + } while (v != a);
  return false;
  }
  +static size_t countOpenEdges(const EdgeAdjacency& adjacency, unsigned int vertex, unsigned int* last = 0)
  +{
  + size_t result = 0;
  +
  + unsigned int count = adjacency.counts[vertex];
  + const unsigned int* data = adjacency.data.data + adjacency.offsets[vertex];
  +
  + for (size_t i = 0; i < count; ++i)
  + if (!findEdge(adjacency, data[i], vertex))
  + {
  + result++;
  +
  + if (last)
  + *last = data[i];
  + }
  +
  + return result;
  +}
  +
  static void classifyVertices(unsigned char* result, size_t vertex_count, const EdgeAdjacency& adjacency, const unsigned int* remap, const unsigned int* wedge, size_t lockedstats[4])
  {
  for (size_t i = 0; i < vertex_count; ++i)
  