MCPcopy Create free account
hub / github.com/DiscordMessenger/dm / NearestPowerOfTwo

Function NearestPowerOfTwo

src/windows/AvatarCache.cpp:10–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8//#define DISABLE_AVATAR_LOADING_FOR_DEBUGGING
9
10static int NearestPowerOfTwo(int x) {
11 if (x > (1 << 30))
12 return 1 << 30;
13
14 if (x < 2)
15 return 2;
16
17 int i;
18 for (i = 1; i < x; i <<= 1);
19 return i;
20}
21
22static AvatarCache s_AvatarCacheSingleton;
23AvatarCache* GetAvatarCache() {

Callers 1

GetURLMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected