Commit graph

2 commits

Author SHA1 Message Date
Kp 9e58992296 Flatten constant_xrange hierarchy 2022-02-27 14:23:53 +00:00
Kp 078a9affa0 Make MAX_SIDES_PER_SEGMENT an iterable range
Iterating over it returns each side number in turn.  This allows
converting many loops of the form:

```
	for (int i = 0; i < MAX_SIDES_PER_SEGMENT; ++i)
```

to the compact form:

```
	for (const auto i : MAX_SIDES_PER_SEGMENT)
```

The compact form brings the usual benefit of range-based for: delegating
iteration to the compiler prevents the loop body from skipping a step,
and makes clear in the code that this is the case.
2022-01-09 15:25:42 +00:00