Skip the pointer arithmetic.

Bard was right that the iterator_range returns the underlying
native pointers. Therefore can write the computation much more
natural.
This commit is contained in:
Markus Blatt 2015-01-14 21:58:37 +01:00
parent 1b6bbb035e
commit 9cf21d87ee

View File

@ -66,7 +66,7 @@ double faceArea(const UnstructuredGrid& grid, int face_index)
int faceTag(const UnstructuredGrid& grid,
boost::iterator_range<const int*>::const_iterator face)
{
return grid.cell_facetag[&(*face)-&(*(cell2Faces(grid)[0].begin()))];
return grid.cell_facetag[face-cell2Faces(grid)[0].begin()];
}
SparseTableView cell2Faces(const UnstructuredGrid& grid)