MCPcopy Create free account
hub / github.com/crawl/crawl / cap

Function cap

crawl-ref/source/format.cc:313–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311}
312
313static inline void cap(int &i, int max)
314{
315 if (i < 0 && -i <= max)
316 i += max;
317 if (i >= max)
318 i = max - 1;
319 if (i < 0)
320 i = 0;
321}
322
323char &formatted_string::operator [] (size_t idx)
324{

Callers 2

tostringMethod · 0.85
displayMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected