MCPcopy Create free account
hub / github.com/ddnet/ddnet / SanitizeAge

Function SanitizeAge

src/engine/client/serverbrowser_http.cpp:25–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23using namespace std::chrono_literals;
24
25static int SanitizeAge(std::optional<int64_t> Age)
26{
27 // A year is of course pi*10**7 seconds.
28 if(!(Age && 0 <= *Age && *Age < 31415927))
29 {
30 return 31415927;
31 }
32 return *Age;
33}
34
35// Classify HTTP responses into buckets, treat 15 seconds as fresh, 1 minute as
36// less fresh, etc. This ensures that differences in the order of seconds do

Callers 2

RunMethod · 0.85
UpdateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected